On 2020-01-25 8:23 am, Aaron Hill wrote:
On 2020-01-25 7:48 am, Kieren MacMillan wrote:
Also: I notice that rests and skips are ignored:
This is intuitive/understandable to me (given the functions we’re
using); and I’m glad they’re just ignored [rather than causing
errors]. But how can I turn every rest or skip into a skip [of
equivalent duration] in the output? My intuition tells me I should use
an if statement… but I’m betting there’s a more automagic way. =)
My reading comprehension skills are quite lacking today... :P
You wanted to convert rests to skips, and I ignored that. This should
work:
%%%%
\version "2.19.83"
rests-to-skips =
#(define-music-function (music) (ly:music?)
(music-map
(lambda (elem)
(if (memq 'rest-event (ly:music-property elem 'types))
(make-music 'SkipEvent 'duration (ly:music-property elem
'duration))
elem))
music)
music)
test = { c'4 r d' s e' r f' s g' }
<<
{ \test }
{ \rests-to-skips \test }
%%%%
-- Aaron Hill