Hi there :
I’m finished chapter 5,and tried use variables,functions and
threads to build a drum machine.
All that i got was this :
Drum Machine Test
Note Durations
w = 4
h = 2
q = 1
e = 0.5
s = 0.25
use_bpm 60
Drum Samples
bd = :drum_heavy_kick
sn = :drum_snare_hard
hh = :drum_cymbal_closed
Drum Kit
in_thread(kik: :kik) do
loop do
kik
end
end
in_thread(snr: :snr) do
loop do
snr
end
end
in_thread(hht: :hht) do
loop do
hht
end
end
Drum Pattern
define :kik do
cue :kik
sample bd,amp: 1,pan: -0.1
sleep q
end
define :snr do
sync :kik
sample sn,amp: 0.5,pan: 0.1
sleep q
end
define :hht do
sample hh,amp: 0.5,pan: 0.1
sleep e
end
Can anybody build a drum machine better than this ?
All ideas are wellcome.
Thank you.