I'm defining drum loops like this (thanks @ericcervin for the suggestion):
;; Lists of name, num-beats, instrument and amplitudes, 0=mute
(defloop hats 8 hat [0 0.5 0 0.5 0 0.5 0 0.5])
(defloop kicks 8 kick [0.7 0 0.2 0 0.7 0.6 0.2 0 ])
But any ideas on how I could support fractional beats? The classic example would be a kick and hat alternating, with the kick on each beat and the hat on the off-beats.Code here: https://github.com/ericclack/overtone-loops
I was thinking about something like this: (defloop hats (4 2) hat [0 0.5 0 0.5 0 0.5 0 0.5])
where (4 2)
means 4 beats in a bar and the data is in half beats.
Or (defloop hats (4 1/2) hat [0 0.5 0 0.5 0 0.5 0 0.5])
Or (defloop hats 4 hat [(0 0.5) (0 0.5) (0.05) (0 0.5)])
where each tuple represents fractions of each beat. So you could also have (defloop kicks 4 kick [1 1 1 1])
for basic on-beat kick.
I think I'd use something like (defloop hats 0.5 hat [0 0.5 0 0.5 0 0.5 0 0.5])
That's the clearest format I think. I need to include the 4 too as that's the number of beats in each bar.
Here's where I am at the moment, I decided to try both syntaxes 🙂 https://groups.google.com/d/msg/overtone/1nJi8UIduJk/_7e07QywDwAJ
Hmm....Thinking about how this is laid out on my drum machine, a copy of a TR909. I guess including the 4 is useful to specify what is the "scale" on my machine. Set that to 3 if I want to work with triplets.
super delayed response, but you might get some mileage from some of my repos and posts: https://github.com/gilesbowkett/basic-beat https://github.com/gilesbowkett/arx https://truthindustri.es
Hmm...just saw something I didn't see the last time I was in your github. Stared for later.
Thanks @gilesb I'll check those repos out.