Skip to content

Instantly share code, notes, and snippets.

@senz
Created April 3, 2016 17:51
Show Gist options
  • Save senz/a8d80094ce01485d0e9e952fb7157405 to your computer and use it in GitHub Desktop.
Save senz/a8d80094ce01485d0e9e952fb7157405 to your computer and use it in GitHub Desktop.
Shepard tone Sonic Pi code
# github.com/senz
use_synth :mod_sine
use_bpm 40
counter = 0
v1l = [:C3, :D3, :E3, :F3, :G3, :A3, :B3].ring
v2l = [:C4, :D4, :E4, :F4, :G4, :A4, :B4].ring
v3l = [:C5, :D5, :E5, :F5, :G5, :A5, :B5].ring
a = 1
s = 0
r = v1l.size + 2
loop do
with_fx :reverb do
v1 = play v1l[counter], attack: a, release: r, sustain: s, note_slide: 1
v2 = play v2l[counter], attack: a, release: r, sustain: s, note_slide: 1
v3 = play v3l[counter], attack: a, release: r, sustain: s, note_slide: 1
(r-2).times do
control v1, note: v1l[counter]
control v3, note: v2l[counter]
control v3, note: v3l[counter]
counter = (inc counter)
sleep 1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment