Sunrays

24/10/2022 2 min
Sunrays

Episode Synopsis

# This track was produced in Sonic Pi https://sonic-pi.net

# It's released as open source and this is the code right here (as an instrumental)

use_bpm 88
#link
go = false
chr = (ring :e4, :f4, :d4, :e4, :f4, :a4)
ts = (ring 2.5, 1.5, 4)
rhy = (ring 0.5, 2, 1.5)
with_fx :reverb, mix: 0.4, room: 0.5 do
chain = 0.05
with_fx :level, amp_slide_shape: 6 do |v|
live_loop :v_ctrl do
control v, amp_slide: chain, amp: 0.02, on: go
sleep chain
control v, amp_slide: 0.4, amp: 1
sleep rhy.tick-chain
end
with_fx :flanger, delay: 100, max_delay: 200, depth: 200, phase: 8, feedback: 0.7, mix: 0.55 do
use_synth :mod_fm
use_synth_defaults cutoff: 99, mod_phase: 1/2.0, mod_wave: 2, mod_range: 0.9
live_loop :narp do
(ring 24, 6).tick(:b).times do
n = chr.tick
t = ts.look
l = look
in_thread do
(t*3).times do |i|
play (chord n+24, :major, num_octaves: 2).pick, on: l>6, sustain_level: 0.6, decay: 0.1, amp: rand(0.45), sustain: rand(0.5), release: rand(0.3), pan: rand(2)-1
sleep 0.25
if i%4==0 then sleep 0.25 end
end
end
in_thread do
8.times do |i|
play (chord n, :major, num_octaves: 4, invert: tick)[i]-rand(0.05), pan: 2*(i/8.0)-1, amp: 0.17, decay: 0.06, sustain_level: 0.4, sustain: 1, release: t-1, mod_phase: 1/3.0+rand(0.02)
sleep 1/16.0
end
end
in_thread do
sleep 1
((t-1)*4).times do |i|
play (chord n+12-0.04*i*i, :major), amp: 0.45, release: 0.1, pan: i%2*2-1
sleep 0.25
end
end
sleep t
end
sleep 32
end
with_fx :bitcrusher, bits: 10, sample_rate: (pitch_to_ratio :e1)*3000 do
with_fx :distortion, distort: 0.8, amp: 0.5 do
live_loop :lyrx do
sleep 16+32
with_fx :panslicer, phase: 1/3.0 do
#sample "REDACTED1.wav"
end
with_fx :panslicer, phase: 1/3.0, invert_wave: 1 do
#sample "REDACTED2.wav", amp: 0.9
end
stop
end
end
end
end

with_fx :distortion, distort: 0.85, amp: 0.95 do
with_fx :slicer, phase: 0.25, mix: 0.99, pulse_width: 0.85, smooth: 0.04 do
live_loop :baze do
n = chr.tick
t = ts.look
2.times do |i|
in_thread do
use_synth [:beep, :tri][i]
cn = play n-48, on: go, note_slide_curve: 6, sustain: t-0.75, attack: 0.03, pan: [-1,1][i]
control cn, note_slide: 0.45, note: n-36
sleep 0.5
sleep t/2.0
control cn, note_slide: t/2.0, note: n-48
sleep t/2.0-0.5
end
end
sleep t
end
end
end
live_loop :spsh do
sleep 15.5
go = (ring true, true, false).tick
2.times do
sample :elec_hi_snare, beat_stretch: 0.35, amp: 1.2
sleep 0.25
end
sample :drum_splash_hard, amp: 0.75, beat_stretch: 5
end
end

with_fx :wobble, wave: 3, res: 0.3, cutoff_min: 88, cutoff_max: 104, phase_offset: 0.5, phase: 2 do |w|
live_loop :deez do
sample :loop_amen_full, beat_stretch: 16, on: go, amp: 0.9
sleep 12
sample :loop_amen_full, beat_stretch: 16, start: 0.75, finish: 0.5, amp: 0.7
sleep 4
end
end
end

live_loop :kik do
sample :loop_amen, num_slices: 8, slice: 6, amp: 0.1, on: go
sample :bd_tek, amp: 0.9, on: go
sleep rhy.tick
end

More episodes of the podcast The Happy Feels Company