Skip to content

Instantly share code, notes, and snippets.

@mbutz
Last active December 3, 2017 13:38
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/6b9eb741081718ad91ee9535ac45ab6b to your computer and use it in GitHub Desktop.
Save mbutz/6b9eb741081718ad91ee9535ac45ab6b to your computer and use it in GitHub Desktop.
# Superflu v2
# filename: superflu-02.rb
# Listen to version 1 at: https://soundcloud.com/mbutz/superflu-1
use_bpm 120
# Download sample from: www.mkblog.org/download/superflu.wav
# and adjust path to sample:
path="~/projects/sonicpi/playground/audio/samples/sonicpi"
# Unfortunately I did not save the code for the creation of this loop
# It is basically made of sounds created with synth :fm
live_loop :beat do
sleep 1
end
live_loop :bar, sync: :beat do
sleep 4
end
live_loop :my_superflu, sync: :bar do
stop
with_fx :lpf, cutoff: (range 50, 130, step: 5).ramp.tick do
sample path, "superflu", beat_stretch: 16, finish: 0.5
at [0] do
with_fx :slicer, phase: 0.75, mix: 0.5, smooth: 0.25 do
with_fx :slicer, phase: 0.25 do
sample path, "superflu", beat_stretch: 16, finish: 0.5, amp: 0.5
end
end
end
end
sleep 8
end
live_loop :hihat01, sync: :bar do
stop
sleep 0.5
with_synth :cnoise do
with_synth_defaults release: 0.15, amp: 0.5, pan: 1 do
with_fx :hpf, cutoff: [110,115,120].choose do
play :c
end
end
end
end
live_loop :hihat02, sync: :bar do
stop
if spread([16].choose, 16).reverse.tick
with_synth :cnoise do
with_synth_defaults release: 0.085, amp: 0.75, pan: -1 do
with_fx :hpf, cutoff: 120 do
play :c
end
end
end
end
sleep 0.25
end
live_loop :kick, sync: :bar do
stop
with_fx :lpf, cutoff: (range 30, 130, step: 1).ramp.tick, mix: 1 do
sample :bd_ada, amp: 0.75
end
sleep 1
end
live_loop :echolot, sync: :bar do
stop
use_synth :fm
use_synth_defaults depth: 0.5, divisor: 0.5
with_fx :reverb, room: 0.75, mix: 0.5 do
at [7.5] do
play :c5, release: 0.125, pan: 0.5, amp: 0.125
end
at [7.75] do
play :f5, release: 0.125, pan: -0.5, amp: 0.5
end
end
sleep 16
end
live_loop :keys, sync: :bar do
stop
master = 1.0
ptn = (ring
0,0.5,0,0,
0,0.5,0,0.5,
0,0.25,0.5,0,
0,0,0.5,0,
0,0,0,0,
0,0,0,0.5,
0,0.25,0.5,0,
0,0,0,0
)
use_synth :dtri
use_synth_defaults attack: 0.009, attack_level: 12, release: 0.175, cutoff: 70, pan: 0.35
c = (ring :f4,:c5,:d5,:f5,:g5,:c5)
with_fx :reverb, room: 0.995, mix: 0.25 do
play c, amp: ptn.look * master if ptn.tick > 0
end
sleep 0.25
end
live_loop :cluster, sync: :bar do
stop
use_synth :dtri
use_synth_defaults cutoff: 70, amp: 0.095
with_fx :reverb, room: 0.95, mix: 0.95 do
at [8] do
play (invert_chord(chord :c4, 'sus4', num_octaves: 3),2), attack: 6, release: 16, pan: -1
sleep 4
play (invert_chord(chord :c4, 'sus2', num_octaves: 3),2), attack: 7, release: 16, pan: 0.75
sleep 4
play (invert_chord(chord :f3, 'sus2', num_octaves: 3),3), attack: 4, release: 12, pan: -0.75
sleep 4
play (invert_chord(chord :f3, 'sus4', num_octaves: 3),3), attack: 5, release: 12, pan: 1
end
at [20] do
play (invert_chord(chord :g3, 'sus4', num_octaves: 3),2), attack: 8, release: 12, pan: -1
sleep 4
play (invert_chord(chord :g3, 'sus2', num_octaves: 3),2), attack: 7, release: 12, pan: 0.75
sleep 5
play (invert_chord(chord :d3, 'sus4', num_octaves: 3),3), attack: 5, release: 18, pan: 1
sleep 1.5
play (invert_chord(chord :d3, 'sus2', num_octaves: 3),3), attack: 7, release: 18, pan: -0.75
end
at [48] do
play (invert_chord(chord :f3, 'sus2', num_octaves: 3),2), attack: 8, release: 48, pan: -1
sleep 4
play (invert_chord(chord :f3, 'sus4', num_octaves: 3),2), attack: 5, release: 48, pan: 0.75
sleep 7
play (invert_chord(chord :c3, :minor7, num_octaves: 3),1), attack: 7, release: 80, pan: 1
sleep 4
play (invert_chord(chord :c3, :minor7, num_octaves: 3),1), attack: 7, release: 80, pan: -0.75
end
sleep 128
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment