I’d been looking to “emulate” a 303… but got sucked into the world of “random” (typical!)
anyway, I thought I’d post my playTime results if anyone is interested!
any “proper coders” that can streamline this, or point out proper ways of chopping up arrays etc, please do comment!
use_cue_logging false
use_debug false
use_bpm 60
# 303 ?
def shift cutOff, res
use_synth :tb303
use_synth_defaults release: 0.125, cutoff: cutOff, res: res, wave: 0, sustain: rand() / 10.0, decay: range(0.05, 0.125, 0.05).to_a.sample
end
shift(0,0)
co = range(0, 130, 5).mirror
r = range(0, 1, 0.01).mirror
counter = 0
oNotes = n = [:e1, :f1, :g1,:e2, :f2, :g2, :e3, :f3, :g3, :e4, :f4, :g4]
oTimes = [0.25, 0.5, 0.25, 0.125, 0.125, 0.5, 0.25]
times = oTimes.shuffle
notes = []
8.times do
notes.append(oNotes.sample)
end
live_loop :threeohthree do
tick
#if look % 4 == 1
cc = co.look.to_i
rr = r.look
'''
if range(0, 10, 1).to_a.sample == 1 # random!
cc = rand() * 100
rr = rand()
end
'''
shift(cc, rr)
counter = look # counter + 1
puts "shifted! cc=#{cc} rr=#{rr} counter=#{counter}"
if [*5..8].include? counter
notes = [:e1, [:e2, :f2].sample, :f2, :e2, :g3, :g2, :f1, :e3]
elsif [*9..12].include? counter
notes = [:e1, [:e2, :f2, :g2].sample, :f2, [:e2, :e3, :e4].sample, :g3, :g2, :f1, :e3]
elsif [*13..24].include? counter
notes = [:e1, [:e2, :f2, :g2].sample, :f2, [:e2, :e3, :e4].sample, :g3, [:g2, :g3, :f2, :f3, :e2, :e3, :e4].sample, :f1, :e3]
else
n = oNotes + [:g4, :a2, :d2, :c2]
notes = []
8.times do
notes.append(n.sample)
end
times = oTimes.shuffle
end
#end
with_fx :echo, decay: 4, mix: 0.2, phase: [0.125, 0.25, 0.5, 0.666, 0.999].look do
play_pattern_timed notes, times
end
end