[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Replace the notes in a phrase (drum notation) with scheme?
From: |
Stefano Antonelli |
Subject: |
Re: Replace the notes in a phrase (drum notation) with scheme? |
Date: |
Tue, 28 Apr 2020 23:06:59 -0700 |
On Tue, 2020-04-28 at 20:53 +0200, Gilles Thibault wrote:
> >
> > I appreciate the suggestion, but I don't think that helps. I can
> > see
> > that you are replacing whole bars of music, which is kinda cool in
> > fact. However, it doesn't help me with my goal which is to not
> > have to
> > define groovec at all.
> Yes ok. Below a solution replacing only one note, all 4 measures. No
> groovec.
> Not perhaps the simplest solution however because you have to add
> \repeat unfold 16
> in each voices. (Probably not what you whished...)
Thank you very much again for the suggestions.
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> A = \drummode { \voiceOne \repeat unfold 8 hh8 }
> B = \drummode { \voiceOne { s4 sn4 s4 sn4 } }
> C = \drummode { \voiceTwo { bd8 bd8 r4 bd8 bd8 bd8 bd8 } }
>
>
> grooveFinal = \drummode { <<
> \multiReplaceMusic \repeat unfold 16 \A
> { cymc8 s1*0
> cymc8 s1*4
> cymc8 s1*8
> cymc8 s1*12 }
> \\
> \repeat unfold 16 \B
> \\
> \repeat unfold 16 \C
> }
Indeed this is a bit verbose. The problem is not with the definitions
of A, B, and C. Those I could live with. But the formation of
grooveFinal doesn't work for me. Mainly because the repeat happens
elsewhere.
I combine all the drum phrases into a single variable that I'll include
in a score (and unfolded for midi in another score):
theMusic = \drummode {
\leadin
\dtMarkSection "Intro"
\introc \repeat percent 3 {\intro}
\dtMarkSection "Verse"
\versec \repeat percent 5 {\verse}
\dtMarkFill "Fill 1" \fillI |
}
\dtMarkxxxx are for formatted rehearsal marks. \leadin, \introc,
\intro, \versec, \verse, and \fillI would be defined like groove (ie.
polyphonic, up to 4 voices).
What I would like to do is remove \introc and \versec definitions and
instead have:
theMusic = \drummode {
\leadin
\dtMarkSection "Intro"
\crashAtStart { \repeat percent 4 {\intro} }
\dtMarkSection "Verse"
\crashAtStart { \repeat percent 6 {\verse} }
\dtMarkFill "Fill 1" \fillI |
}
where \crashAtStart can be defined in an include file for all projects.
The important part here is that \crashAtStart be an "inline function"
for lack of a better word.
Solutions other than above probably won't be an improvement for me.
> This other solution use a very small groovec. Perhaps it will not
> work
> in 2.18 (uses \voices). I think it is the lighter solution.
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> A = \drummode { \repeat unfold 8 hh8 }
> B = \drummode { s4 sn8 s s4 sn8 s } % <- little change here to
> avoid
> notes collision
> C = \drummode { bd8 bd8 r4 bd8 bd8 bd8 bd8 }
>
> groovec = \drummode { \voices 1,1,2 << cymc8 \\ s8 \\ bd8 >> }
>
> groove = { \voices 1,1,2 << \A \\ \B \\ \C >> }
>
> 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"
> \grooveFinal }
> }
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
You're right this does not work in 2.18, but I'm not tied to 2.18
either. Just too lazy to upgrade when everything currently works (or
has a working workaround).
Unfortunately, as explained above, this would be too verbose as well.
> Extended features are in preparation (in a few weeks ?). This will
> make
> more easier to deal with simultaneous music. Not ready for now. Sorry
I'm not in a rush and thank you again for the help. I'll gladly
revisit this topic when those extended features are ready.
Thanks,
Stef