Skip to content

Instantly share code, notes, and snippets.

@uncompiled
Last active February 7, 2016 14:46
Show Gist options
  • Save uncompiled/d45060bfefe4369f6c1f to your computer and use it in GitHub Desktop.
Save uncompiled/d45060bfefe4369f6c1f to your computer and use it in GitHub Desktop.
Fun with Bizet's Habanera for Sonic Pi
# Mixer ########################################
theme_channel = 1
bass_channel = 0
slicer_channel = 0
sparkle_channel = 0
# Fader ########################################
overall_volume = 1
bass_volume = 0.5
sparkle_volume = 1
sparkle_speed = 0.125
################################################
define :habanera do
# From Bizet's Carmen
mode = 0
notes = [(ring :d, :r, :r, :a, :f5, :r, :a, :r),
(ring :d, :r, :r, :Bb, :g5, :r, :Bb, :r)]
tick
play notes[mode].look, release: 0.1, amp: 1 * overall_volume
play notes[mode].look - 12, release: 0.3, amp: 1 * overall_volume
sleep 0.25
end
live_loop :bizet do
with_fx :reverb, room: 0, mix: 0.3 do
if slicer_channel > 0
with_fx :slicer, phase: 0.125 do
synth :blade, note: :d4, release: 8,
cutoff: 100, amp: 0.5 * overall_volume
end
end
if theme_channel > 0
2.times do
habanera
end
end
end
end
# We need a beat.
live_loop :ind do
if bass_channel > 0
sample :loop_industrial, beat_stretch: 1,
cutoff: 100, rate: 1, amp: bass_volume * overall_volume
end
sleep 1
end
live_loop :sparkle_pony do
if sparkle_channel > 0
notes = (chord :d, :minor, num_octaves: 4)
play notes.choose, release: sparkle_speed, amp: sparkle_volume * overall_volume
end
sleep sparkle_speed
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment