Skip to content

Instantly share code, notes, and snippets.

@mbutz
Last active July 10, 2018 18:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbutz/4be114efccbde3e38dba44903ab245d1 to your computer and use it in GitHub Desktop.
Save mbutz/4be114efccbde3e38dba44903ab245d1 to your computer and use it in GitHub Desktop.
# A coding study done with Sonic Pi exploring the Drum'n'Bass genre.
# I used a sample from freesound.org, a female voice singing 'Shireau' to be
# found at (https://freesound.org/people/maurolupo/sounds/212669/) and some drumsamples
# from Partners In Rhyme (look for: Free Drum Loop Downloads: Drum 'n' Bass).
# Shireau
use_bpm 170
hihats = "~/projects/sonicpi/audio/samples/looplords/07/"
voice = "~/projects/sonicpi/audio/samples/freesound/"
dnb = "~/projects/sonicpi/audio/samples/partners_in_rhyme/"
live_loop :metro do
sleep 1
cue :beat
sleep 7
cue :phrase
end
live_loop :arp, sync: :phrase do
#stop
with_fx :sound_out_stereo, output: 9 do
ptn = (range 45,30).mirror # 70,60,50
sample voice, "shire", num_slices: ptn.tick, slice: 20, attack: 0.0725, release: 0.0125, pitch: (ring 0,-2,5,-5,7,0,0).look, amp: 0.75#, pitch: [0,0,0,0,0,0,2,-2,5,-5].choose
end
sleep 0.25
end
live_loop :hihat, sync: :phrase do
stop
with_fx :sound_out_stereo, output: 11 do
#sample hihats , "hat", beat_stretch: 8, amp: 0.5
at (ring 0,4) do
sample hihats, "hat", beat_stretch: 4, amp: 0.25
end
end
sleep 8
end
live_loop :bass, sync: :phrase do
#stop
cnt = tick % 8
n = :cs1
if cnt < 4 then
n = :cs1
elsif cnt < 6 then
n = :e1
elsif cnt < 8
n = :fs1
end
use_synth :fm
use_synth_defaults attack: 0.001, attack_level: 8, sustain: 3, release: 0.025, divisor: 1, depth: 1, amp: 0.75
with_fx :sound_out_stereo, output: 7 do
s = play n
i = 0
32.times do
i += 1
control s, depth: (ring 2, 8)[i]
sleep 0.25
end
end # output
end
live_loop :drums, sync: :phrase do
#stop
with_fx :sound_out_stereo, output: 11 do
sample dnb, [5,6,7,8].choose, beat_stretch: 16, amp: 3#, num_slices: 8, slice: pick
end
sleep 16
#sleep 2
end
live_loop :shireau, sync: :phrase do
#stop
with_fx :sound_out_stereo, output: 5 do
with_fx :reverb, room: 1.0, mix: 0 do |rev|
with_fx :pan, pan: 1 do |pan|
control pan, pan: -0.75, pan_slide: 8
control rev, mix: 1, mix_slide: 8
sample voice, "shire", amp: 1.5
end
end
end
sleep 32
end
live_loop :synth, sync: :phrase do
#stop
ptn = (ring [:gs6,:ds6],[:e6,:b6],[:cs6,:fs6],[:e6,:b6],[:cs6,:as6],:r,:r,:r) +
(ring :r,:r,:r,:r,:r,:r,:r,:r) +
(ring [:gs6,:ds6],[:e6,:b6],[:cs6,:fs6],[:e6,:b6],[:b6,:cs6],:r,:r,:r) +
(ring :r,:r,:r,:r,:r,:r,:r,:r)
rel = (ring 2,2,2,2,18,0,0,0)
use_synth :blade
use_synth_defaults amp: 0.5, attack: 0.25, vibrato_depth: 0.25
with_fx :sound_out_stereo, output: 5 do
play ptn.tick, release: rel.look
with_fx :pitch_shift, pitch: -12 do
play ptn.look, release: rel.look, amp: 0.25
end
end
sleep 2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment