lilypond-devel
[Top][All Lists]
Advanced

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

Re: Scheme function to print out active Voice context during interpretat


From: Han-Wen Nienhuys
Subject: Re: Scheme function to print out active Voice context during interpretation?
Date: Mon, 15 Dec 2008 12:18:11 -0200

On Mon, Dec 15, 2008 at 11:25 AM, Trevor Bača <address@hidden> wrote:

> 6. Lily reads the terminal close } brace. Even here, I'm willing to bet,
> Lily sees no reason to kill off the explicit named "foo" context. I bet Lily
> reads the terminal close } brace and instead simply closes off the original
> music *expression*. My guess would be that not until EOF does Lily finally
> kill off the original named "foo" context.

EOF does not play any role in this. The parsing into trees of music
expressions is done beforehand, and the iteration is not connected
directly with the input file.

Each iterator contains a pointer to the context it delivers events to.
 This pointer is actually reference counted, and a context is ended
when its reference count drops to zero.

> ==> naked { } expressions DO NOT cause contexts to be instantiated at the
> open { brace and destroyed at the close } brace.

Look for descend_to_bottom().  Generally, event chords (rests, notes,
lyrics) cause a bottom context (lyrics, voice, chordnames) to be
instantiated as child of the current context.

The iterator for { } (sequential) will change its context to the one
of its child if that child has a deeper level than the current one.
so,

  \new Staff { c d }

the iterator for 'c' will create a Voice, the enclosing iterator will
change from Staff to Voice, since Voice is deeper nested in the
context tree.

> This is a super long-winded way of me coming around to Carl's mental model:

Try not to form mental models.  Use the source instead.

-- 
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen

reply via email to

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