Great, thanks Jean!

It made the editor compatible with 2.25.x series too

On Sun, Feb 19, 2023 at 2:18 AM Jean Abou Samra <[email protected]> wrote:

> Le dimanche 19 février 2023 à 02:09 +0100, Paolo Prete a écrit :
>
> Hello LilyPonders,
>
> Currently, I checked that Spontini-Editor has an incompatibility with LP
> 2.25.x (it works well with 2.24.x branch) due to this bug:
>
> https://gitlab.com/lilypond/lilypond/-/issues/6482
>
> More specifically, the incompatibility happens when hidden tuplets of
> skips, which don't compile in the 2.25.x series, are dynamically created by
> the cross-staff libraries of the editor, e.g:  \tuplet 3/2 {s8 s s}
> Of course I'll wait that the LP issue gets fixed, but given that it can
> take some time, I'm considering to work around it, meanwhile, with a Scheme
> filter that does the following transformation:
>
> { c' d' \tuplet 3/2 { s8 s s } f'  \tuplet 5/4 { s4 s s s s } }
>
> becomes
>
> {  c ' d' s8 s f'  s4 s s s } }
>
> (NOTE: skips inside the tuplets have no articulations, nor dynamics etc.)
>
> Therefore I gently ask: is it trivial to write such a Scheme function? If
> simple, how can I implement it?
>
> NOTE 2: if the resulting Scheme code is long, I'd probably (?) wait until
> the issue gets fixed.
>
> Thanks very much!
>
> So IIUC, you want to remove tuplets that contain only skips?
>
> Try something like this:
>
> \version "2.25.2"
>
> noSkipTuplets =
> \musicMap
> #(lambda (m)
>    (if (and (music-is-of-type? m 'time-scaled-music)
>             (every (lambda (e)
>                      (music-is-of-type? e 'skip-event))
>                    (extract-typed-music m 'rhythmic-event)))
>        (ly:music-property m 'element)
>        m))
> \etc
> toplevel-music-functions = #(cons noSkipTuplets toplevel-music-functions)
>
> {
>   \tuplet 3/2 { c'8 d' e' }
>   c' d'
>   \tuplet 3/2 { s8 s s }
>   f'4
>   \tuplet 5/4 { s4 s s s s }
> }
>
> When it encounters a tuplet with no notes inside, it removes the tuplet
> music wrapper, leaving only the inner (time-scaled) music.
>
> Best,
>
> Jean
>

Reply via email to