On 2019-12-19 3:03 pm, Matt Wallis wrote:
What I want to do is to automatically create a click track for any
length of music, and any time signature. For example, if the music is
L measures in length, and the numerator of the time signature is N,
and the denominator is D, then I want a click track that looks like
this:
\repeat unfold <L> \drummode { wbh<D> \repeat unfold <N-1> { wbl\pp }}
Here's a quick-and-dirty way to achieve close to what you want:
Firstly, \clickTrack is a function for generating one measure of
clicking based on a desired beat and meter. The beat defaults to the
denominator of the meter if unspecified. If the beat duration does not
divide the measure perfectly, a final rest is inserted to pad out the
measure. Here are examples of use:
%%%%
\repeat unfold 8 \clickTrack 2 4/4 % click on 1 and 3
\repeat unfold 8 \clickTrack 4/4 % click on all four
\repeat unfold 8 \clickTrack 4. 6/8 % click on 1 and 4
\repeat unfold 8 \clickTrack 4 6/8 % click on 1, 3, and 5
\repeat unfold 8 \clickTrack 6/8 % click on all six
%%%%
Secondly, \clickTrackDuring is a very basic wrapper for \clickTrack that
automatically repeats the click measure to cover the duration of the
specified music. Note that no attempt is made to handle music that
changes time signature nor music with \partial measures or other funny
business. If you had a anacrusis, you would need to manually offset the
music:
%%%%
% Assume \musicWithPickup begins with \partial 4
\clickTrackDuring 3/4 { s2 \musicWithPickup }
%%%%