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: Marc Hohl
Subject: Re: function to replace notes by rests
Date: Tue, 24 Nov 2015 11:03:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Am 24.11.2015 um 10:43 schrieb Marc Hohl:
Am 24.11.2015 um 09:52 schrieb David Kastrup:
[...]

Even better, thanks a lot!

Well, nearly there. Is it possible to use this function only within a certain Staff?

If I write

xNote =
#(define-music-function (music) (ly:music?)
   (make-relative (music) music
    (music-map
     (lambda (m)
       (if (eq? (ly:music-property m 'name) 'NoteEvent)
           (make-music 'RestEvent
             'duration (ly:music-property m 'duration))
           m))
     (ly:music-deep-copy music))))

\include "myfiles.ily" % <- \mel and \text defined here

\score {
  <<
    \new Staff {
       \new Voice = "mel" { \mel }
    }
    \new Lyrics \lyricsto "mel" { \text }
    \new Staff \with { midiInstrument = "alto sax" } { \mel }
  >>
  \midi { }
  \layout { }
}

the lyrics are displaced because the "spoken" notes are replaced globally with rests. This is a feature for proofreading only,
if there is no easy way, I'll comment out the first staff with the lyrics.

Marc




_______________________________________________
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]