Skip to content

Instantly share code, notes, and snippets.

@fatuk
Forked from findscode/dnb.rb
Created August 30, 2023 11:29
Show Gist options
  • Save fatuk/51bb3f03272197680eb048af5d92c2ab to your computer and use it in GitHub Desktop.
Save fatuk/51bb3f03272197680eb048af5d92c2ab to your computer and use it in GitHub Desktop.
My Drum&Bass template
samps = "C:/Program Files (x86)/Sonic Pi/etc/my-samples"
use_bpm 170
live_loop :metro do
sleep 1
cue :beat
sleep 7
cue :ambient
end
live_loop :ambi, sync: :ambient do
with_fx :reverb, room: 0.1 do
sample samps, 0, attack: 8, amp: 0.1
sleep 25
end
end
with_fx :reverb, mix: 0.7 do
use_synth :hollow
live_loop :note1 do
play choose([:D5, :E5]), attack: 6, release: 6, amp: 0.5
sleep 8
end
end
live_loop :hihat, sync: :beat do
# stop
with_fx :sound_out_stereo, output: 10 do
sample :drum_splash_soft, attack: 0.02, sustain: 0.01, release: 0.03
sleep 0.5
2.times do
sample :drum_splash_soft, attack: 0.02, sustain: 0.01, release: 0.03
sleep 2
end
sample :drum_splash_soft, attack: 0.02, sustain: 0.01, release: 0.03
sleep 0.5
end
end
live_loop :amen, sync: :beat do
with_bpm 170 do
amen = :loop_amen
sample amen, amp: 0.3, rate: 1.25
sleep (sample_duration amen, amp: 0.3, rate: 1.2419)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment