|
From: | Marc Hohl |
Subject: | Re: function to replace notes by rests |
Date: | Tue, 24 Nov 2015 08:10:32 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
Am 23.11.2015 um 21:41 schrieb Malte Meyn:
Am 23.11.2015 um 10:46 schrieb Marc Hohl:As the file is a bit lengthy, I think of a way to just redefine \xNotes to change every note to its corresponding rest, instead of rewriting the whole file (or using sed or any other external script). Has anyone a scheme routine at hand that does exactly this job?
Malte,
I wrote this but it doesn’t work well in relative mode: \version "2.19.30" notesToRests = #(define-music-function (music) (ly:music?) (music-map (lambda (m) (if (eq? (ly:music-property m 'name) 'NoteEvent) (make-music 'RestEvent 'duration (ly:music-property m 'duration)) m)) music)) \relative { c' d e f \notesToRests { g a b2 g8 c } f e c2 }
Thanks or sharing! The drawbacks in relative mode are neglectable, I'll use absolute mode.
Marc
[Prev in Thread] | Current Thread | [Next in Thread] |