[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change_iterator refuses to move a NullVoice into a Staff

From: Dan Eble
Subject: Re: Change_iterator refuses to move a NullVoice into a Staff
Date: Wed, 5 Apr 2017 23:47:53 -0400

David Kastrup <address@hidden> writes:

> For something like
> \change StaffGroup = "what"
> the change iterator looks at the current context hierarchy upwards until
> it finds a "StaffGroup" as a parent.  The layer below that is the
> context to move, and if it is significantly similar in specification to
> the context that should be/become its parent, it might become hard to
> move back and forth.
> So it's likely a bit of work/thought to make sure one does not create
> context trapdoors from which it is hard to escape.  Hovercraft parent
> contexts.

A context change involves specific pruning and grafting points, but the current 
syntax of the command can be ambiguous.

The grafting point is ambiguous if there multiple contexts with the same type 
and ID nearby (a vague statement betraying vague understanding).  I see that as 
a possibility, though the user’s option to choose context IDs seems to mitigate 
that problem.

The pruning point is ambiguous if the \change command is nested in more than 
one context of the given type.  This is the case in my situation where 
NullVoice is aliased to Staff, but I actually want to prune between the 
enclosing Staff and the NullVoice.

* * *

Now that I’ve said that, I’ve been able to work around my problem by creating a 
new kind of context to target (see below).  I haven’t tested it in a serious 
score yet.  I don’t much mind having to define a special context, but I do 
consider it ugly that the \change command must refer to a context outside 
Lilypond’s standard model.

Back to the bug: I appreciate that it’s not obvious what to do with 
Change_iterator, but is there anything obvious that could be done to NullVoice 
that (without defeating its purpose) would cause \change Staff to pass over it?


\version "2.19.58"

sopranoNotes = \fixed c' {
  c1 d e f
  \change TrueStaff = "S"
  g a b c'

\layout {
  \context {
    \name TrueStaff
  \context {
    \accepts TrueStaff

\new ChoirStaff \with {
  \override VerticalAxisGroup.remove-first = ##t
} <<

  \new TrueStaff = "S" \with {
    instrumentName = "S"
    shortInstrumentName = "S"
  } {
    $(skip-of-length sopranoNotes)

  \new TrueStaff = "SA" \with {
    instrumentName = "SA"
    shortInstrumentName = "SA"
  } <<
    \new Voice { \sopranoNotes }
    \new NullVoice = "soprano" { \sopranoNotes }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]