lilypond-user
[Top][All Lists]
Advanced

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

Re: function to replace notes by rests


From: Jacques Menu
Subject: Re: function to replace notes by rests
Date: Tue, 24 Nov 2015 08:27:04 +0100

Hello Malte,

Interesting, but why are there halves instead of quarters in the second staff?

JM


\version "2.19.32"

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
}

\relative {
  c' d e f \notesToRests \relative { g' a b2 g8 c } f' e c2
}



Le 24 nov. 2015 à 08:21, Malte Meyn <address@hidden> a écrit :



Am 24.11.2015 um 08:10 schrieb Marc Hohl:
Thanks or sharing! The drawbacks in relative mode are neglectable, I'll
use absolute mode.


Alternatively you could use

1. another \relative block inside of notesToRests
\relative {
  c' d e f \notesToRests \relative { g' a b2 g8 c } f' e c2
}

or

2. octave checks if you don’t mind the warnings
\relative {
  c' d e f \notesToRests { g a b2 g8 c } f='' e c2
}

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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