I wanted to test the command “with_swing” (“heeey” ^^)
with_swing -0.1, pulse: 3 do
It’s fine but I have an error after more than 3 minutes
Runtime Error:[buffer 7, line 35] - SonicPi::Lang::Core::TimeTravelError
Thread death +--> :live_loop_foo
Time travel error - a jump back of -0.1 is too far.
Sorry, although it would be amizing, you can't go back in time beyond the sched_ahead time of 0.5
use_bpm 65
# hexadecimal/binary rhythmic scheme
# 0=0000, 1=0001, 2=0010, 3=0011
# 4=0100, 5=0101, 6=0110, 7=0111
# 8=1000, 9=1001, a=1010, b=1011
# c=1100, d=1101, e=1110, f=1111
def schr2(num)
num.hex.to_s(2).rjust(num.size*4, '0').split(//).collect { |n| n == "1" }.ring
end
live_loop :a do #sequences
6.times do
X = tick; sleep 12
end
tick_reset
end
live_loop :b do #chords
4.times do
I = tick; sleep 3
end
tick_reset
end
live_loop :foo do #samples/notes
chords = (ring 1, 2, 5, 1)
if X<4
abc=(chord_degree chords[I], :c3,:major,4)
else
abc=(chord_degree chords[I], :b2,:major,4)
end
puts X
puts I
with_swing -0.1, pulse: 3 do
sample :drum_snare_soft, amp: 1.5 if schr2('924').tick ^ (one_in 12) # drum
sample :drum_cymbal_closed, amp: 1 if schr2('aaa').look ^ (one_in 24) # drum
sample :bd_haus, amp: 2 if schr2('888').look ^ (one_in 32) # drum
with_fx :bitcrusher do
sample :bd_tek, amp: 3.5 if schr2('800').look ^ (one_in 31) # drum
sample :elec_hi_snare, amp: 1.5 if schr2('020').look ^ (one_in 30) # drum
end
use_synth :chiplead
play abc, amp: 1,release: 0.2 if schr2('8cb').look ^ (one_in 32) # chord
use_synth :dpulse
play abc.choose+12, amp: 0.5,release: 0.3 if (one_in 3) # solo
use_synth :fm
play abc.butlast.reflect.look-12, amp: 1.2,release: 0.4 if schr2('924').look ^ (one_in 12) # bass
end
sleep 0.125
end