Skip to content

Instantly share code, notes, and snippets.

@stungeye
Created July 23, 2022 11:46
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 stungeye/645fc922cd6c4c52425d8d6d7d58e843 to your computer and use it in GitHub Desktop.
Save stungeye/645fc922cd6c4c52425d8d6d7d58e843 to your computer and use it in GitHub Desktop.
Sonic Pi Demo
live_loop :bass_drum do
##| sample :bd_haus
sample :bd_haus, cutoff: 70, amp: 4
sleep 0.5
end
live_loop :amen_break do
##| sample :loop_amen, beat_stretch: 2
##| sample :loop_amen, beat_stretch: 2, amp: 6, cutoff: 100
##| with_fx :slicer, phase: 0.125, wave: 0 do
##| sample :loop_amen, beat_stretch: 2, amp: 6, cutoff: 100
##| end
##| p = [0.125, 0.125, 0.125, 0.25].choose
##| with_fx :slicer, phase: p, wave: 0, mix: rrand(0.8, 1) do
##| sample :loop_amen, beat_stretch: 2, amp: 6, cutoff: 100
##| end
sleep 2
end
live_loop :landing do
bass_line = ring(:e2, :e2, :e2, [:c2, :c3].choose)
##| bass_line = ring(:e6, :e5, :e6, [:c4, :g5].choose) # At End
##| s = synth :square, note: bass_line.tick
##| s = synth :square, note: bass_line.tick, cutoff: 70
##| s = synth :square, note: bass_line.tick, sustain: 4, cutoff: 70
##| with_fx :slicer, phase: 0.25 do
##| s = synth :square, note: bass_line.tick, sustain: 4, cutoff: 70
##| end
##| with_fx :slicer, phase: 0.25 do
##| s = synth :square, note: bass_line.tick, sustain: 4, cutoff: 70
##| control s, cutoff_slide: 4, cutoff: 120
##| end
sleep 4
end
# Need to sync somehow?!
live_loop :squelch do
use_synth :tb303
n = (ring :e1, :e2, :e3).tick
##| play n, release: 0.125, cutoff: 100, res: 0.8, wave: 0, amp: 2
sleep 0.125
end
live_loop :random_riff do
use_synth :dsaw
##| use_random_seed 666 # Increase manually.
use_random_seed [30, 50, 60, 666].choose
notes = (scale :e3, :minor_pentatonic).shuffle
16.times do
##| play notes.tick, release: 0.2, cutoff: 90, amp: 3 if one_in(2)
sleep 0.125
end
end
# Return to :landing for high distorted bass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment