lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme function to affect a compound music expression?


From: Peter Crighton
Subject: Re: Scheme function to affect a compound music expression?
Date: Sat, 25 Oct 2014 17:41:11 +0200

2014-10-24 23:01 GMT+02:00 Peter Crighton <address@hidden>:
2014-10-24 16:54 GMT+02:00 Robin Bannister <address@hidden>:
So it looks like LilyPond wants to merge the rests,
but will do this only if they seem identical.


Having read through the regression snippet
and been inspired by the way it removes things,
we can modify bgr to make it remove rests:

bgr = #(define-music-function (parser location music) (ly:music?)
  (music-map (lambda (mus)
    (if (music-is-of-type? mus 'rest-event)
      (make-music 'SkipEvent mus)
      #{
        \tweak NoteHead.font-size #-2
        \tweak Accidental.font-size #-2
        #mus
      #}))
    music ))

Note A: found 'rest-event in the Internals Reference
Note B: renamed your parameter to not imply just "note"

Hope this helps.

Thanks again, Robin, this helps a lot!

The next time I dive into Scheming I might be getting further by myself before I have to ask on the list. :)

Nope, I didn’t really and have to ask again, sorry …

I now wanted to improve the function to also skip MultiMeasureRests and first tried replacing 'rest-event with 'multi-measure-rest-event to see if that would work, which it doesn’t. I searched a lot for other examples where something similar might appear, but I couldn’t find anything, so I’m (again) rather clueless.
Do I need to replace something else? Do MultiMeasureRests require another approach? Or is it not possible with them?

--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de


reply via email to

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