Journal

Sonic Pi afternoon session 3

Cet article n’existe qu’en anglais.

Moody guitars with a slow beat and noisy saws, using random euclidean patterns with spread and dice.

Part of the Sonic Pi notebook, 2016–2018.

Tonight some moody guitars with a slow beat and noisy saws in the background.  As usual you can find the code under the video. I used spread (dice(x), x).tick to make some random euclidean patterns as documented The Euclidean Algorithm Generates Traditional Musical Rhythms (pdf)  by Godffried Toussain, implemented in Sonic-Pi via spread, it allows for non-repetitive but cohesive structures with the use of dice to randomize the patterns.  The track is a bit slow to get alive, especially considering some typo mistakes slowing down the process, but hey, it’s a practice session and it’s supposed to be slow to evolve and moody.

Overall Sonic-Pi’s approach to live-coding is very interesting, easy to dive into but has enough depth to allow for a big margin in creativity and after reading some examples, I’ve come to understand I still got a lot to learn.

live_loop :guitar do
if spread(3, 8).tick then
sample :guit_em9, amp: 0.0, rate: 0.5, beat_stretch: 1
with_fx :distortion do
with_fx :slicer do
with_fx :pitch_shift, pitch: 24 do
sample :guit_em9, amp: 0.0, rate: 0.2, beat_stretch: 4
sample :ambi_glass_rub, amp: 0.0, rate: 0.6, beat_stretch: 5
end
end
end
end
sleep 4
end
live_loop :guitar2 do
with_fx :distortion, distort: 0.1 do
with_fx :reverb, room: 1 do
if spread(dice(8), 8).tick then
s = synth :pluck, release: 0.25, attack: 0.1, amp: 0.0, pluck_decay: 100, coef: 0.5
control s, note: chord(:e2, :minor).choose
end
sleep 0.25
end
end
end
live_loop :kicks do
if spread(0, 8).tick then
sample :bd_haus, amp: 0.4, cutoff: 80
with_fx :distortion do
sample :bd_boom, amp: 0.9, cutoff: 90
end
end
sleep 0.25
end
live_loop :cymbal do
sleep 2
with_fx :pitch_shift do
sample :drum_cymbal_soft, amp: 0.0, sustain: 4, rate: -1, release: 5
sleep 1
end
sleep 4
end
live_loop :noise do
with_fx :reverb, room: 1 do
with_synth :supersaw do
play chord(:e3, :minor).choose,
detune: rrand_i(-16,-4), detune_slide: [1, 2, 4, 8, 12, 16].choose,
amp: 0.0, attack: 2, sustain: 2, release: [1, 3, 5].choose
sleep 8
end
end
end
live_loop :noise2 do
with_fx :reverb, room: 1 do
with_synth :supersaw do
play chord(:e4, :minor).choose,
detune: rrand_i(-16,-4), detune_slide: [1, 2, 4, 8, 12, 16].choose,
amp: 0.0, attack: 0.1, sustain: 1, release: [1, 3, 5].choose
sleep 8
end
end
end
live_loop :hh do
stop
sleep 15.75
with_fx :reverb, mix: 0.3, room: 0.8 do
with_fx :echo, mix: 0.4, decay: 8, phase: 0.75 do
sample :drum_cymbal_soft, amp: 0.1
end
end
sleep 0.25
end

Originally published on svdk.fr in 2016.

Esc