[Top][All Lists]

[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: Fri, 12 Aug 2011 00:34:35 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Aug 10, Reinhold Kainhofer wrote:
> Am Mittwoch, 10. August 2011, 17:11:44 schrieb Ricardo Wurmus:
> > On Aug 10, Neil Puttock wrote:
> > > BTW, if you're prepared to wrap the notes in a chord (so you have
> > > access to 'articulations), you won't even need a scheme engraver (all
> > > the processing can take place in the NoteHead's stencil callback).
> >
> > It should be a generic engraver, so I cannot assume that notes will
> > always be wrapped in a chord. I'll play around with defining a function
> > for process-acknowledged and see where it leads me.
> One detail that might be interesting for you is that you can define engraver-
> wide variables by wrapping the whole engraver in a (let (..) ...) block.
> See e.g. the scheme engraver instance regtest (input/regression/scheme-
> in the source code tree):
> In this example, instance-counter is a global variable, which is reused by
> every voice, while instance-id and private-note-counter are variables that are
> separate for each voice. In this example, instance-id stores the number of the
> voice, while private-note-counter counts the number of notes in each voice
> separately.
> In particular, the engravers used in the first and in the second voice will
> have different private-note-counter variables.
> You can use this to collect information from all encountered objects and thin
> in 'process-acknowledged or 'stop-translation-timestep procell all of them at
> once. For a list of all possible "functions" inside the engraver, see
> input/regression/

Thanks, this helped me quite a bit. The engraver is already working
basically. Will just have to clean up and add a few more features.

> Cheers,
> Reinhold


reply via email to

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