lilypond-devel
[Top][All Lists]
Advanced

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

Re: Naming _another_ lacking puzzle piece


From: David Kastrup
Subject: Re: Naming _another_ lacking puzzle piece
Date: Sat, 13 Oct 2012 09:16:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Werner LEMBERG <address@hidden> writes:

>> So we need something like
>> 
>> crossStaff =
>> #(define-music-function (parser location notes) (ly:music?)
>>   (_i "Create cross-staff stems")
>>   #{
>>   \temporary\override Stem #'cross-staff = #cross-staff-connect
>>   \temporary\override Flag #'style = #'no-flag
>>   $notes
>>   \revert Stem #'cross-staff
>>   \revert Flag #'style
>> #})
>> 
>> and, as a corrollary, \temporary\whatever and \undo\whatever will be a
>> proper push/pop pair.
>
> I like the name \temporary.  Is this of practical use outside of music
> functions also?

The main point is to restore to a previous state after a temporary
override.  This is of course also useful in music assigned to music
variables.  In the context of a larger music piece, you can, of course,
just repeat any previous overrides that you want to see reestablished,
but this is not cut&paste friendly.

Maybe \push\override ... but this has the disadvantage that you never
actively see a \pop.  Hm.  Maybe we should rename \undo to \pop then?

>> Opinions?  It might also be possible to do
>> 
>> \temporary { \override Stem #'cross-staff = #cross-staff-connect
>>              \override Flag #'style = #'no-flag }
>>            $notes
>
> I like that too.

It is less versatile, though.

> What about
>
>   \push { Stem.cross-staff = #cross-staff-connect
>           Flag.style = #'no-flag }
>   $notes
>   \pop { Stem.cross-staff
>          Flag.style }
>
> [I'm using the `.' operator creatively; no idea whether this works,
> and no need to discuss this in case it doesn't :-)]

It doesn't.  And I don't even have an awfully twisted idea how to beat
LilyPond into supporting this in any meaningful manner.

-- 
David Kastrup



reply via email to

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