lilypond-user
[Top][All Lists]
Advanced

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

Re: Replace the notes in a phrase (drum notation) with scheme?


From: Gilles Thibault
Subject: Re: Replace the notes in a phrase (drum notation) with scheme?
Date: Tue, 28 Apr 2020 02:14:07 +0200
User-agent: Webmail Free/1.3.3

groove = \drummode {
        <<
        \voiceOne { \repeat unfold 8 {hh8}}
        \\
        \voiceOne { s4 sn4 s4 sn4 }
        \\
        \voiceTwo { bd8 bd8 r4 bd8 bd8 bd8 bd8 }
        >>
}


Hello Stafano.
Perhaps you can try \multiReplaceMusic, a function from
extractMusic.ly described here :
http://lsr.di.unimi.it/LSR/Item?id=542

(Please see advices for downloading in the bottom of the message)

%%%%%%%%%%%%%%%%%%%%%%%
\include "extractMusic.ly"

groove = \drummode {
        <<
        { \voiceOne \repeat unfold 8 hh8 }
        \\
         { \voiceOne s4 sn4 s4 sn4 }
        \\
         { \voiceTwo bd8 bd8 r4 bd8 bd8 bd8 bd8 }
        >>
}

groovec = \drummode {
        <<
         { \voiceOne cymc8 \repeat unfold 7 hh8 }
        \\
         { \voiceOne s4 sn4 s4 sn4 }
        \\
         { \voiceTwo bd8 bd8 r4 bd8 bd8 bd8 bd8 }
        >>
}


grooveFinal = \multiReplaceMusic \repeat unfold 16 \groove {
                \groovec s1*0
                \groovec s1*4
                \groovec s1*8
                \groovec s1*12 }


\score {
        \new DrumStaff {
                \set Staff.instrumentName = #"drums"
                \new DrumVoice { \grooveFinal }
        }
        \layout {
                \override NoteColumn.ignore-collision = ##t
        }
}

%%%%%%%%%%%%%%%%%%%%%%%%%

1-
The link for downloading is :
   http://gillesth.free.fr/Lilypond/extractMusic/
The link is valid but the web interface is very very very slow ... (+ 5 mn)
(don't known why)
With a program like wget it will be very fast :
   wget -np -r http://gillesth.free.fr/Lilypond/extractMusic/
(download is done in the current path)

2- extractMusic.ly is for Lilypond 2.19 and later.
For Lilypond 2.18, chose extractMusic2.16.ly in the directory.

3- There is also a basic doc



--
Gilles

Attachment: test.png
Description: PNG image


reply via email to

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