Journal

Acid-techno in Sonic Pi

An acid-techno live coding session built on layers of TB-303 synths.

Part of the Sonic Pi notebook, 2016–2018.

code after the break

live_loop :acid4 do
sleep 4
end
live_loop :acidpad, sync: :acid4 do
stop
with_fx :slicer, phase: 0.125, amp_min: 0.5 do
use_synth :tb303
play chord(:e4, :minor).tick, release: 8, amp: 0.1, res: 0.99, cutoff: 60
sleep 4
end
end
#let's add some tb303 with a high res
live_loop :ambichoir, sync: :acid4 do
stop
sample :ambi_choir, rate: -0.5, beat_stretch: 4, attack: 4, amp: 0.125
sleep 4
end
# some darkish intro
# and add a lot of layers
live_loop :acidpad2, sync: :acid4 do
stop
with_fx :panslicer, phase: 0.25 do
use_synth :tb303
play chord(:c5, :minor).tick, release: 8, amp: 0.5, res: 0.45, cutoff: 40
sleep 4
end
end
live_loop :acidpad3, sync: :acid4 do
tick
ctrlcutoff = (ramp *range(5, 40, 1)).look
stop
with_fx :panslicer, phase: 0.25 do
use_synth :tb303
play chord(:c2, :minor).look, release: 8, amp: 0.7, res: 0.45, cutoff: ctrlcutoff
sleep 4
end
end
live_loop :acidpad4, sync: :acid4 do
stop
with_fx :panslicer, phase: 0.25 do
use_synth :tb303
play chord(:c7, :minor).tick, release: 8, amp: 0.5, res: 0.45, cutoff: 40
sleep 4
end
end
live_loop :acidpad5, sync: :acid4 do
stop
with_fx :panslicer, phase: 0.5 do
use_synth :tb303
play chord(:c8, :minor).tick, release: 2, amp: 0.3, res: 0.99, cutoff: 80
sleep 4
end
end
live_loop :bass, sync: :acid4 do
stop
synth :sine, amp: 0.1, note: :c3, release: 1
sleep 0.5
end
live_loop :rythmics2 do
stop
tick
freqvar = (line 120, 40, steps: 64).mirror.look
with_fx :krush, gain: 3 do #gain
with_fx :distortion, distort: 0.9 do
sample :mydrum_shaker, amp: 0.4, lpf: freqvar, rate: (line 0.6, 1.4).look
sleep 0.125
end
end
end
live_loop :rythmics, sync: :acid4 do
tick
stop
freqvar = (line 60, 20, steps: 64).mirror.look
with_fx :krush, gain: 1 do #gain
with_fx :distortion, distort: 0.9 do
sample :drum_cymbal_closed, amp: 0.3, lpf: freqvar, rate: (line 0.5, 1.5).look
sleep 0.125
end
end
end
live_loop :acidbassline, sync: :acid4 do
with_fx :level, amp: 0.7 do
#stop
tick
notelist = (stretch [:e3, :e4], 32).look
#ctrlcutoff = (ramp *range(5, 120, 1)).look
ctrlcutoff = 1
with_fx :lpf, cutoff: ctrlcutoff do
phasevar = (line 0.125, 1, steps: 256).look
freqvar = (line 40, 65, steps: 64).mirror.look
with_fx :reverb do
use_synth :tb303
play chord((stretch [:e4, :c4], 32).look, :minor).look, release: 0.125, cutoff: freqvar*2, pan: (line -0.5, 0.5, steps: 32).mirror.look, amp: 0.2
play chord((stretch [notelist, :c3], 32).look, :minor).look, release: 0.125, cutoff: freqvar*2, pan: (line -0.5, 0.5, steps: 32).mirror.look, amp: 0.2
sleep 0.125
end
#end
end
end
end
define :kick do
sample :bd_sone, amp: 0.25, lpf: 90
sample :bd_pure, lpf: 60
end
define :snare do
sample :drum_cymbal_pedal, amp: 0.8, attack: 0.05
end
define :cymb do
sample :drum_cymbal_closed, amp: 0.5, lpf: 88
sample :drum_cymbal_closed, amp: 0.25, rate: -0.5, lpf: 70
end
live_loop :drum, sync: :acid4 do
stop
tick
with_fx :reverb, room: 0.6 do
tick_reset if look >= 7
kick if look % 8 == 0 or look % 8 == 4 or look % 8 == 5
snare if look % 8 == 2 or look % 8 == 7 or look % 8 == 7
sleep 0.5
end
end
live_loop :kicka, sync: :acid4 do
stop
tick
kick if look % 8 == 3
sleep 0.25
end
live_loop :hihat, sync: :acid4 do
stop
tick
with_fx :echo, phase: 0.25 do
with_fx :flanger, phase: 0.125 do
#tick
tick_reset if look >= 7
cymb
end
end
sleep 0.5
end
live_loop :hh, sync: :acid4 do
#stop
sample :drum_cymbal_closed, amp: rrand(0.01, 0.03), hpf: 115
sleep 0.125
end

Originally published on svdk.fr in 2017.

Esc