lilypond-user
[Top][All Lists]
Advanced

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

Re: How to limit customized graceSettings?


From: Thomas Morley
Subject: Re: How to limit customized graceSettings?
Date: Sat, 17 Aug 2013 18:59:48 +0200

2013/8/17 David Kastrup <address@hidden>:
> Thomas Morley <address@hidden> writes:
>
>> is there any easy way to limit customized graceSettings to Voice?
>>
>> While using $(add-grace-property ...), any further setting of it will
>> override the former.
>
> Have you taken a look at add-grace-property?  It's rather appalling.  It
> figures out the level where the grace settings have been defined, and
> overrides them _there_.

Yep.
But I didn't get the quick fix:
https://codereview.appspot.com/13088043/
Thanks a lot.

> I think it shouldn't do that but rather set them at the _current_ level.
> The same for remove-grace-property.  Of course, that means that if you
> override the Staff or Voice grace properties while in a \Voice context,
> the Staff properties will get ignored altogether (as there can be no
> Staff within a Voice), and the Voice properties will only hold for this
> Voice.
>
> I don't mind that.  I'd expect overrides at Score level if you want to
> have them hold globally.
+1

Though, another problem arises. I can't make work the following code.
Either add-grace-property is ignored or LilyPond complains about
clashing note columns, regardless of the use of the old
add-grace-property or your fix.
Issue 630
?
http://code.google.com/p/lilypond/issues/detail?id=630


\version "2.17.24"

% The new:
#(define-public (add-grace-property context-name grob sym val)
   "Set @address@hidden for @var{grob} in @var{context-name}."
   (define (set-prop context)
    (let* ((current (ly:context-property context 'graceSettings))
            (new-settings (append current
                                  (list (list context-name grob sym val)))))
      (ly:context-set-property! context 'graceSettings new-settings)))
  (make-apply-context set-prop))

\new Staff % \with { $(add-grace-property 'Voice 'NoteHead 'style 'cross) }
{
 <<
   \new Voice \with { $(add-grace-property 'Voice 'NoteHead 'style 'mensural) }
   { \voiceOne c''1 \grace d''8 \voiceOne c''4 }
   \new Voice \with { $(add-grace-property 'Voice 'NoteHead 'style 'diamond) }
   { \voiceTwo c'1 \grace d'8 \voiceTwo c'4 }
 >>
}

Any idea?

Thanks,
  Harm



reply via email to

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