lilypond-user
[Top][All Lists]
Advanced

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

Re: how to modify `afterGraceFraction` mid-score?


From: Valentin Petzel
Subject: Re: how to modify `afterGraceFraction` mid-score?
Date: Thu, 19 Dec 2024 09:14:16 +0100

Hello Werner,

> In full scores it is sometimes necessary to adjust the value of
> `afterGraceFraction` so that it harmonizes with other notes and
> rhythms.  However, saying
> 
> ```
> afterGraceFraction = <value>
> ```
> 
> only works at top-level according to the documentation.  How can I
> change this value mid-score?
> 
> 
>     Werner

you can use `set!`:

{
  \afterGrace c' c' \break
  #(set! afterGraceFraction 999/1000)
  \afterGrace c' c' \break
  s1
}

But note that this may cause race conditions, and `afterGrace` allows 
specifying the ratio as optional first argument. In this sense I would deem it 
safer to use that optional argument over going around changing the default all 
the time.

Cheers,
Valentin

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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