Skip to content

Instantly share code, notes, and snippets.

@mbutz
Last active November 2, 2017 19:21
Show Gist options
  • Select an option

  • Save mbutz/bb363b2c5ff82bf2c3ed4a32d6fa2643 to your computer and use it in GitHub Desktop.

Select an option

Save mbutz/bb363b2c5ff82bf2c3ed4a32d6fa2643 to your computer and use it in GitHub Desktop.
Performance Issue Sonic Pi, 2016-05-16
use_bpm 125
set_sched_ahead_time! 4
# Timer Loops -------------------------------------------------------
live_loop :atom do
sleep 0.25
end
live_loop :bar, sync: :atom do
sleep 4
end
comment do
live_loop :pattern, sync: :bar do
sleep 16
end
end
# Keyboard -----------------------------------------------------------
syn_line = (ring\
[:c4,:eb4,:g4,:d5,:f5],
[:c4,:eb4,:g4,:d5,:f5],
:r,
[:f4,:c4,:eb4,:g4,:d5],
:r,
:r,
[:c4,:eb4,:d5,:f5,:a5],
:r,
[:bb4,:eb4,:d5,:g5],
:r,
[:c4,:eb4,:g4,:d5,:f5],
[:bb4,:eb4,:d5,:g5],
:r,
:r,
[:c4,:eb4,:g4,:d5,:f5],
:r,
:r
)
live_loop :keyboard, sync: :bar do
use_synth :sine
use_synth_defaults amp: 1, attack: 0, sustain: 0.2, release: 0.02, pan: rrand(-1, 1)
play syn_line.tick
sleep 0.25
end
# Kick --------------------------------------------------------------
kick_pattern = (ring\
2, 0, 1.5, 0,
1.5, 1.5, 0, 0,
1.5, 0, 0, 0.5,
2, 0, 1.5, 0,
0, 2, 0, 1.5,
2, 0, 0, 2,
1.5, 0.5, 0, 0,
1.5, 0, 0, 1)
live_loop :kick, sync: :bar do
use_synth :fm
use_synth_defaults divisor: 12, attack: 0, sustain: 0, release: 0.15, cutoff: 80, depth: 2
if kick_pattern.tick > 0
play :c1, amp: kick_pattern.look * 4
play :g1, amp: kick_pattern.look * 1
end
sleep 0.25
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment