[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ambitus
From: |
Neil Puttock |
Subject: |
Re: Ambitus |
Date: |
Tue, 2 Mar 2010 21:57:27 +0000 |
On 27 February 2010 15:03, David Kastrup <address@hidden> wrote:
> But wouldn't scores in a book use separate engraver instantiations and
> have separate ambitus for that reason?
Not until Nicolas's commit today.
In any case, it doesn't seem appropriate to use a scheme engraver
here, since there are no grobs created or context properties set.
> Uh, what's with the $defaultheader here?
Oops, I missed a rather important line when pasting, which should make it clear:
\header { subtitle = \markup \fromproperty #'header:ambitus }
>> (ly:parser-define! parser 'pitches '())
>> (ly:parser-define! parser 'key-list '())
>
> What does that do? Why per-parser?
It's equivalent to doing
pitches = #'()
"key-list" = #'()
or
#(define pitches '())
#(define key-list '())
They're just global variables used to store information from the music
so it can be passed to the ambitus markup.
>
>> (let* ((global (ly:make-global-context $defaultlayout))
>> (listener (ly:make-listener process-event))
>> (global-disp (ly:context-events-below global)))
>>
>> (ly:connect-dispatchers (ly:make-dispatcher) global-disp)
>> (add-stream-listener global listener 'note-event 'key-change-event
>> 'Finish)
>> (ly:interpret-music-expression music global)
>> music))
>
> What does this do? Route the music expression through a parser with a
> simple listener, then regurgitate it for the outer context?
It just interprets the parsed music expression and listens for some
interesting events (it's a lazy way of getting information out of the
music).
> It would seem that this approach would not work when you want, say, an
> ambitus per Voice, and the input is not continuous, but repeatedly
> switches between contexts.
>
> Then you don't have the whole music available as one music expression.
True, though it's only designed to work with songs having a single vocal line.
Regards,
Neil
- Re: Ambitus,
Neil Puttock <=