I’m trying to make some generative music that’ll only generate a new pattern every 8 bars. My solution was working until I tried to add the ability to generate whether a note played or not by using an array to give amp values.
For some reason, while the code didn’t totally cease to function when I added the amp array, it now only repeats the first 4 notes in the loop. Any idea what happened or how to fix it?
(also I’m guessing my solution is a bit clumsy with the 64.times do and all that but I wasn’t getting any kind of set/get system to work, so lemme know if you’ve solved this whole thing in a different way)
use_bpm 400
define :basslineMaker do
#note chooser
a = [24,26,28,29,31,33,35,
36,38,40,41,43,45,47,
48,50,52,53,55,57,59]
b=a.choose
c=a.choose
d=a.choose
e=a.choose
f=a.choose
g=a.choose
h=a.choose
i=a.choose
bassline=[b,c,d,e,f,g,h,i]#note on or off
j=[1,1,1,0,0].choose
k=[1,1,1,0,0].choose
l=[1,1,1,0,0].choose
m=[1,1,1,0,0].choose
n=[1,1,1,0,0].choose
o=[1,1,1,0,0].choose
p=[1,1,1,0,0].choose
q=[1,1,1,0,0].choose
amperage=[j,k,l,m,n,o,p,q]64.times do
x=bassline.tick
y=amperage.tick
use_synth :blade
play x, amp:y
use_synth :beep
play x, amp: y
sleep 1
end
endlive_loop :bassPlayer do
basslineMaker
end
Thanks! Thanks! Thanks!