Hi Amelie,
On Wed, Jun 17, 2015 at 4:52 AM, Amelie Zapf <[email protected]> wrote:
> Hi all,
>
> > What's left now is to isolate this function and put it into the other
> > code we already have.
>
>
Rather, you need to put your code into an engraver. You then "consist" the
engraver to a context. You can't get at it within your function. (You
may be able to do something with \applyContext, but I didn't have any luck
when I tinkered around with this.)
> I just had a go at it and am running into problems left and right. If I
> call (myrootpitch (ly:context-property somecontext 'tonic)) I need a
> context as input. The usual context names (like Staff) don't work. The
> original function got the context from the ly:translator-context
> function. This one, however, requires a translator object as input. In
> the documentation, I haven't found a proper explanation what exactly
> constitutes a translator object.
>
>
The context is easily available to a Scheme engraver, either through
ly:translator-context (as here) or as a parameter of the engraver
definition:
#(define myEngraver
(lambda (context)
(make-engraver
[...]
Hope this helps.
David
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user