Menu

#4097 Patch: This adds support for \addlyrics on arbitrary contexts including Staff

Verified
nobody
Enhancement
2014-09-17
2014-09-09
Anonymous
No

Originally created by: *anonymous

Originally created by: dak@gnu.org
Originally owned by: dak@gnu.org

This adds support for \addlyrics on arbitrary contexts including Staff

The regtest should illustrate why this can be an advantage.  At the
current point of time, behavior for melismata is deficient: a melisma
is recognized when all subcontexts have a melisma.  That means that,
for example,

<< c''1 \\ { c'2( d') } >>

counts as two syllables since in the middle of the measure there is
only a melisma in one context.  Proper treatment of melismata will
require more work in the translators and/or additional support from
iterators.

The first upload represents the state of issue4096.  The second upload
contains the commits

Derive melisma_busy state from child contexts when available

Allow associatedVoice to be of different type than Voice

Revert "Convert \new Staff ... \addlyrics into \new Staff \new Voice ... \addlyrics"

This reverts commit [r76f256075f0a4f481d7e11c19dd55ab09030fe5b].

Allow \addlyrics to work with arbitrary contexts

Add regtest for \addlyrics on Staff context

http://codereview.appspot.com/136430043

Discussion

  • Google Importer

    Google Importer - 2014-09-09

    Originally posted by: dak@gnu.org

    (No comment was entered for this change.)

    Owner: dak@gnu.org

     
  • Google Importer

    Google Importer - 2014-09-09

    Originally posted by: dak@gnu.org

    Patchy the autobot says: passes tests.  Since a number of regtests (those that failed in an intermediate version of issue 4096) actually now put the lyrics to Staff context or above, the absence of any changed preexisting regtest is a pretty good sign.

    Labels: -Patch-new Patch-review

     
  • Google Importer

    Google Importer - 2014-09-09

    Originally posted by: dak@gnu.org

    Issue 4044 has been merged into this issue.

     
  • Google Importer

    Google Importer - 2014-09-09

    Originally posted by: janek.li...@gmail.com

    Issue 4044 has been merged into this issue.

     
  • Google Importer

    Google Importer - 2014-09-11

    Originally posted by: pkx1...@gmail.com

    Patch on countdown for September 14th

    Labels: -Patch-review Patch-countdown

     
  • Google Importer

    Google Importer - 2014-09-11

    Originally posted by: pkx1...@gmail.com

    Just for completeness - also passes a full make doc

     
  • Google Importer

    Google Importer - 2014-09-11

    Originally posted by: dak@gnu.org

    Well, probably the issue description is not really overly illuminating
    about what this patch is supposed to be good for.  The description
    refers to the added regtest which happens to be mostly stolen from
    <URL:http://lilypond.org/doc/v2.18/Documentation/notation/common-notation-for-vocal-music#aligning-lyrics-to-a-melody>
    which produces the same output while investing more complexity: the
    version after the patch merely needs an additional underline after
    "love," in order to compensate for the different syllable distribution
    of both stanzas.  The version in the manual juggles with associated
    voices and \lyricsto and cannot make use of the << \\ >> construct.

    \version "2.19.14"

    \header {
      texidoc = "
    @code{\\addlyrics} may get used on a @code{Staff} context and will
    then consider all note events created below it for synchronization.
    "
    }

    \relative \new Staff {
      \time 2/4
      c''4 b8. a16 g4.
      << { [r8] a4( b) c2 } \\      { f,8 e4 d c2 }
      >>
    }
    \addlyrics {
      Life is __ _ love, _ live __ _ life.
    }
    \addlyrics {
      No more let sins and sor -- rows grow.
    }

     
  • Google Importer

    Google Importer - 2014-09-12

    Originally posted by: janek.li...@gmail.com

    Hi David,

    i thought that if \addlyrics can be used with a Staff, then "advanced" methods (i.e. lyricsto) would work as well, but they didn't - with

    <<
      \relative \new Staff = foo {
        \time 2/4
        c''4 b8. a16 g4.
        <<
          { [r8] a4( b) c2 } \\       { f,8 e4 d c2 }
        >>
      }
      \new Lyrics \lyricsto foo {
        Life is __ _ love, _ live __ _ life.
      }
    >>

    I get "Warning: cannot find Voice `foo'".  What do you think about allowing \lyricsto to associate lyrics to non-voice contexts?  Could it be an update for this patch, or a separate issue?

     
  • Google Importer

    Google Importer - 2014-09-12

    Originally posted by: dak@gnu.org

    Contexts are never addressed by id alone, you also need the type.  It just happens that this patch allows you

    \new Lyrics \lyricsto Staff = foo { ... }

    which is not overly pretty (as the meaning without = is different from what \context/\new with just a single word does).  But it is likely about the best one can hope to do here.

     
  • Google Importer

    Google Importer - 2014-09-13

    Originally posted by: janek.li...@gmail.com

    Interesting - i wouldn't think that this can work!

     
  • Google Importer

    Google Importer - 2014-09-13

    Originally posted by: dak@gnu.org

    What's "this" what you consider not workable?  The \lyricsto syntax?  That was a one-liner.  The issue itself is likely more of a surprise (that it works), but in order to deal sensibly with melismata there will be quite a bit of pile-on work.  At the current point of time, I'd stick to bottom contexts.  I hope that the situation in a week will look differently.  Issue 4098 should help, but it requires additional refactoring of Lyric_engraver and Lyric_combine_iterator in order to wrap things together as needed.

     
  • Google Importer

    Google Importer - 2014-09-13

    Originally posted by: pkx1...@gmail.com

    Patch counted down - please push

    Labels: -Patch-countdown Patch-push

     
  • Google Importer

    Google Importer - 2014-09-14

    Originally posted by: dak@gnu.org

    Pushed to staging as
    *   commit [r1c23f39c0f7918d0efe2305d07a17cc6a4d64f65]
    |\&nbsp; Merge: 5b2267a 6a82f23
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Sun Sep 14 07:49:03 2014 +0200
    | |
    | |     Merge branch 'issue4097' into HEAD
    | |  
    | * commit [r6a82f2326523c4e6bb97b9d67e6370c7ec79b24c]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Tue Sep 9 16:54:17 2014 +0200
    | |
    | |     Add regtest for \addlyrics on Staff context
    | |  
    | * commit [rdf3457d85ebfa4bc347a4569241227449f84b901]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Tue Sep 9 11:14:34 2014 +0200
    | |
    | |     Allow \addlyrics to work with arbitrary contexts
    | |  
    | * commit [rfc9070f6ca7945cf30c991b11874de570d90c9e6]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Tue Sep 9 11:04:27 2014 +0200
    | |
    | |     Revert "Convert \new Staff ... \addlyrics into \new Staff \new Voice ... \addlyrics"
    | |    
    | |     This reverts commit [r76f256075f0a4f481d7e11c19dd55ab09030fe5b].
    | |  
    | * commit [r462c01a26eb3b309e70415ea91fbf5c97a204fad]
    | | Author: David Kastrup <dak@gnu.org>
    | | Date:   Tue Sep 9 10:15:35 2014 +0200
    | |
    | |     Allow associatedVoice to be of different type than Voice
    | |  
    | * commit [r899cc9ee6763b5dfc3442c7473be7b88fe70ce34]
    |/  Author: David Kastrup <dak@gnu.org>
    |   Date:   Mon Sep 8 23:19:23 2014 +0200
    |  
    |       Derive melisma_busy state from child contexts when available

    Labels: -Patch-push Fixed_2_19_14
    Status: Fixed

     
  • Google Importer

    Google Importer - 2014-09-14

    Originally posted by: janek.li...@gmail.com

    Yes, i was surprised by "\lyricsto Staff = foo" syntax.
    Thanks for working on this!

     
  • Google Importer

    Google Importer - 2014-09-17

    Originally posted by: ColinPKC...@gmail.com

    (No comment was entered for this change.)

    Status: Verified

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.