On 29 December 2010 22:20, Xavier Scheuer <x.sche...@gmail.com> wrote:
> On 29 December 2010 18:10, Sven Axelsson <sven.axels...@gmail.com> wrote:
>>
>> OK, rtfm:ing and testing a bit further.
>>
>> I created a music function like this:
>>
>> pgrace = #(define-music-function (parser location notes) (ly:music?)
>>  #{ \newSpacingSection
>>     \override Score.SpacingSpanner #'spacing-increment = #0.9
>>     % override Score.SpacingSpanner #'strict-grace-spacing = ##t
>>     \grace $notes
>>  #}
>> )
>
> Just a hint.
> Instead of defining your own music function you could change the default
> behaviour of grace notes by redefining the variables startGraceMusic,
> stopGraceMusic (defined in the file  ly/grace-init.ly ) to include this
>  \override  within the definition of  \grace .
> In this way you can continue using normal  \grace  command without
> having to call your function every time.

In fact I prefer to have a special function for this, because that
lets me use both normal \grace and special behavior \pgrace in the
same score. In some cases, for instance, I want to be able to remove
all (special) grace notes from the output just by setting a variable,
and that is easy using the \pgrace function.

> BTW I think you should consider  Score.GraceSpacing  instead of
>  Score.SpacingSpanner  (just an idea).
> http://lilypond.org/doc/v2.13/Documentation/internals/gracespacing

Considered, tested, and working! Using \override Score.GraceSpacing
#'spacing-increment = #0 gives exactly the output I want. Thank you
for that.

It appears like the value of spacing-increment is multiplied with the
spring value from the layout routine, so using zero, or a small value
(up to 0.25 seems to work) will make the grace note group in effect
unstretchable. This is great, but I would not have guessed it worked
that way just from reading the manual.

> Hope that helps.

It did indeed.

-- 
Sven Axelsson
++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
>++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to