lilypond-devel
[Top][All Lists]
Advanced

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

Re: custom engraver in scheme: accessing nested Music object


From: Ricardo Wurmus
Subject: Re: custom engraver in scheme: accessing nested Music object
Date: Wed, 10 Aug 2011 19:55:49 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Aug 10, Reinhold Kainhofer wrote:
> Am Wednesday, 10. August 2011, 09:44:00 schrieb Ricardo Wurmus:
> > Hello,
> >
> > I'm currently attempting to write a custom engraver in scheme.
> > This is the shortened code:
>
> It will increase the chances for a useful answer dramatically if you could
> attach a working example that one just has to run through lilypond, rather
> than trying to read your code, trying to image how to use it, constructing the
> example myself and then try to figure out how to solve it.

I was trying to simplify it, because my scheme-foo is only a day old.
But I guess you are right. Here is a working example of my engraver:

  https://github.com/rekado/Lilystick

The engraver is in stick-tab-engraver.ly, a test file using the engraver
is test.ly. Running `lilypond test.ly` will generate roughly what I want.
This all fails, though, when more than one Voice is used.

The reason for that is that I'm using event listeners to collect note
properties and evaluate them in the acknowledger code. The listeners are
executed first for all notes at a moment, and then the achnowledger code
(stick-fingers grob) runs. Hence, the global variables (g_string-number,
g_finger ...) are overwritten.

To overcome this, I want to let the acknowledger grab note properties
for each individual grob, instead of having the listeners grab them.

Rekado



reply via email to

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