Skip to content

Instantly share code, notes, and snippets.

@mbutz
Created November 9, 2021 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbutz/07a58ec1b425da8a027609e8f373919f to your computer and use it in GitHub Desktop.
Save mbutz/07a58ec1b425da8a027609e8f373919f to your computer and use it in GitHub Desktop.
Heatherland (Sonic Pi)
# filename: perf-heatherland.rb
use_bpm 120
live_loop :beat do
sleep 4
end
live_loop :kick, sync: :beat do
#stop
with_fx :sound_out_stereo, output: 3 do
at (ring 0, 1, 2, 3, 3.5, 3.75) do
sample kick, 6
end
end
sleep 4
end
live_loop :drums, sync: :beat do
#stop
with_fx :sound_out_stereo, output: 5 do
with_fx :slicer, phase: 0.25, pre_amp: 3 do
sample beats, 3, beat_stretch: 8, rate: 1
end
with_fx :slicer, phase: 0.25, pre_amp: 3 do
#sample beats, 3, beat_stretch: 8, rate: -0.5, start: 0.5
end
end
sleep 8
end
live_loop :hihat, sync: :beat do
#stop
with_fx :sound_out_stereo, output: 3 do
with_fx :echo, phase: 0.25, decay: 1, pre_amp: 1 do
sample hihats, 1, beat_stretch: 4, amp: 1, rate: 0.5
# sample hihats, 2, beat_stretch: 4, amp: 2, rate: 1
end
end
sleep 4
end
live_loop :atmo, sync: :beat do
#stop
with_fx :sound_out_stereo, output: 9 do
with_fx :flanger do
with_fx :slicer, phase: (ring 0.75, 1.25).choose, mix: 1, smooth: 0.25 do
with_fx :rhpf, cutoff: hz_to_midi((ring 250, 300, 500).choose), mix: 0.75, res: 0.75 do
sample atmos, 4, beat_stretch: 64, amp: 0.5, start: (ring 0, 0.25, 0.5, 0.75).choose, attack: 1, release: 1, finish: 0.5, rate: -2, amp: 2
sleep 4
sample atmos, 4, beat_stretch: 64, amp: 0.5, start: (ring 0, 0.25, 0.5, 0.75).choose, attack: 1, release: 1, finish: 0.5, rate: -1, amp: 2
end
end
end
end
sleep 4
end
live_loop :bass, sync: :beat do
#stop
use_synth :fm
use_synth_defaults amp: 1.5, attack: 0.0, sustain: 0.125, release: 0.125, cutoff: 80
ptn1 = (ring :bb2,:bb1,:r,:r, :r,:r,:bb2,:r, :r,:r,:r,:r, :r,:r,:r,:r)
ptn2 = (ring :bb2,:bb1,:r,:r, :r,:r,:bb2,:r, :r,:r,:r,:r, :c2,:c3,:r,:r)
ptn3 = (ring :bb2,:bb1,:r,:r, :r,:r,:bb2,:r, :r,:g2,:bb2,:g2, :c2,:c3,:r,:r)
ptn = (ring ptn1, ptn1, ptn1, ptn2, ptn1, ptn1, ptn1, ptn3).tick
with_fx :sound_out_stereo, output: 3 do
16.times do
play ptn.tick(:p)
sleep 0.25
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment