Sonic Pi diminished bass / practice session
A practice session around a diminished-chord bass line, with the code.
Part of the Sonic Pi notebook, 2016–2018.
Code under the break
define :fadein do
fadein = (ramp * range(0, 1, 0.01)).look
end
live_loop :sync do
sleep 4
end
define :sna do
sample :elec_fuzz_tom, attack: 0.4, amp: 0.7
time_warp 0.125 do
sample :elec_bong, rate: 0.75
end
end
define :kick do
sample :bd_boom, amp: 4
sample :bd_fat
sample :bd_pure, attack: 0.1
end
dens = 2
live_loop :bass2, sync: :sync do
with_fx :lpf, cutoff: 10 do
#stop
amps = (ring 2, 0.5, 0, 0, 1, 0.5, 0, 0,
1, 0, 0.5,0, 1, 0, 0.5, 0).tick
notes = (stretch [:dim7], 64, [:dim],32,[:madd11],32, ).look
use_random_seed 10
s = synth :fm, note: chord(:e1, notes, num_octaves: 2).shuffle.look,
divisor: 1, depth: 3, release: 1, depth_slide: 0.01, amp: amps
control s, depth: amps * 2
use_synth :pluck
use_random_seed 10
with_fx :krush, gain: 2 do
use_synth_defaults pluck_decay: 100, coef: 0.1
play chord(:e1, notes, num_octaves: 2).shuffle.look, amp: amps * 0.005
sleep 0.125
end
end
end
live_loop :sine, sync: :sync do
stop
with_fx :gverb, room: 400, mix: 0.5, damp: 1 do
with_fx :ring_mod, freq: 0.25, mix: 0.5 do
amps = (ring 1, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0.5,0, 1, 0, 0.5, 0).tick
use_synth :growl
use_random_seed 10
use_synth_defaults sustain: 4, res: 0.5, env_curve: 1, hpf: 80
play chord(:e3, :diminished7, num_octaves: 2).shuffle.look, amp: amps * 0.2
sleep 2
end
end
end
live_loop :snare, sync: :sync do
stop
density dens do
if spread(2, 8).tick then
with_fx :echo, phase: 0.125, decay: 4 do
with_fx :reverb, room: 0.8 do
sample :bass_thick_c, amp: 0.4, start: 0.5, finish: 0.9
end
end
end
sleep 2
end
end
live_loop :hh, sync: :sync do
stop
density dens do
with_fx :rhpf, res: rrand(0.5, 0.8), cutoff: (line 42, 128, steps: 8).mirror.tick do
sample :drum_cymbal_closed, amp: rrand(0.05, 0.1)
sleep 0.25
end
end
end
live_loop :drums, sync: :sync do
stop
density dens do
tick
kick if look % 8 == 0 or look % 8 == 3 or look % 8 == 7
sna if look % 8 == 5 or look % 8 == 6
sleep 0.25
end
end
live_loop :snarebreak, sync: :sync do
stop
density dens do
sleep 7.75
with_fx :reverb, mix: 0.7, room: 0.8, damp: 1 do
with_fx :echo, mix: 0.4, decay: 12, phase: 0.25 do
sample :elec_fuzz_tom
sleep 0.25
end
end
end
end
live_loop :fasthat2 do
stop
with_fx :reverb do
with_fx :echo, phase: 0.125 do
with_fx :flanger do
cutoff = (line 45, 90, steps: 32).tick
synth :blade, cutoff: cutoff, note: :cb6, release: 0.125, amp: 0.75
sleep 0.125
end
end
end
end
live_loop :deepbasswithglidingsaw do
stop
with_fx :hpf, cutoff: rrand_i(45, 60) do
with_fx :gverb, room: 10, damp: 0.1 do
s = synth :sine, note: :c2, release: 2, note_slide: 2
v = synth :mod_saw, note: :c1, amp: 0.2, attack: 1, note_slide: 2, phase: 0.125
control s , note: :g2
control v , note: (ring :e3, :g3, :db3).tick
sleep 4
end
end
end
live_loop :supersaw2 do
#stop
tick
s = synth :tech_saws, note: chord(:e2, :diminished7, num_octaves: 2).look, note_slide: 2, cutoff: 80, release: 4, cutoff_slide: 0.1
control s, note: 90, cutoff: 10
sleep 2
end
live_loop :megapad do
tick
stop
with_fx :pitch_shift, pitch: 12 do
with_fx :level, amp: 0.01 do
with_fx :slicer, phase: 8, mix: 0.25 do
with_fx :band_eq, db: 40, freq: 50 do
with_fx :reverb do
with_fx :octaver, super_amp: 2, sub_amp: 0.5, subsub_amp: 0.25, mix: 0.25 do
s = synth :dsaw, note: chord((stretch [:e1, :fb2], 32).look, :minor).look, release: 8, attack: 4, detune_slide: 8
control s, detune: 1.05
sleep 4
end
end
end
end
end
end
end
Originally published on svdk.fr in 2017.