lilypond-user
[Top][All Lists]
Advanced

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

Re: detecting the start and end of a polyphonic passage from scheme


From: Aaron Hill
Subject: Re: detecting the start and end of a polyphonic passage from scheme
Date: Wed, 01 Jul 2020 02:34:20 -0700
User-agent: Roundcube Webmail/1.4.2

On 2020-07-01 2:07 am, Maurits Lamers wrote:
Follow up question: is there a way to know the "parent" of the voices
as they are defined in the code?
In the following example, I would like to determine that voice "two"
splits off from voice "one" without relying on the context-id.
(ly:context-parent ctx) gives me the staff, not the "parent voice"...

[...]

If I am not mistaken, Voices do not form a hierarchy with each other. The parent context will always be some form of Staff. Consider:

%%%%
\version "2.20.0"

\new Voice = outer { e'8 g' \new Voice = inner { a'2 } b'4 }
%%%%

LilyPond syntax might make it appear as if one Voice is "inside" another, but that is an illusion. In reality, the two voices are in parallel with each other. The inlining of the inner Voice here only serves to keep the outer Voice alive.

Here is an alternate way to view the above:

%%%%
\version "2.20.0"

{
  \new Voice = outer { e'8 g' }
  <<
    \context Voice = outer { s2 }
    \new Voice = inner { a'2 }
  >>
  \context Voice = outer { b'4 }
}
%%%%

Hopefully it is more clear that the two Voices are siblings, not parent-child.


-- Aaron Hill



reply via email to

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