lilypond-user
[Top][All Lists]
Advanced

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

Re: Getting the name of the context a scheme function was called from


From: Paul Morris
Subject: Re: Getting the name of the context a scheme function was called from
Date: Fri, 11 Jan 2013 19:02:29 -0500

On Jan 11, 2013, at 12:40 PM, David Kastrup <address@hidden> wrote:

>> But to do that I need the "translator object" (which seems to be an
>> engraver?), and I'm not sure how to do that.  Maybe there is a way to
>> get to it from the grob?
> 
> A grob can be announced in multiple contexts, so no.

Ok, thanks.


>> displaceHeads =
>> #(define-music-function (parser location offsets) (list?)
>> "
>> Moves the NoteHeads, using (shift offsets)
>> "
>> #{
>>   \once \override NoteColumn #'before-line-breaking = #(shift offsets)
>> #})
> 
> At the time this is called, there are no live contexts.  You might want
> to try fiddling with the context grob properties (huh, do we even have
> functions for that?) directly in a function called via \applyContext.

Ok, good to know about \applyContext.  After looking into it a bit, I'm not 
sure whether it will do what I need it to do, but that's fine since this is not 
essential.  It's just something that would be nice to have.  I can always just 
copy and paste the music and then add or remove the overrides that go in it 
(one version of the music for each of the two staff types).  

(I also should be able to write some code to automatically do the overrides in 
my custom staff context instead of having to enter them manually.  That would 
be the ideal solution, and a better place to put the effort.)

Thanks,
-Paul


reply via email to

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