Skip to content

Instantly share code, notes, and snippets.

@threedaymonk
Created November 19, 2022 19:10
Show Gist options
  • Save threedaymonk/05df4c3f6e4eb78684bd8d3ac73ff785 to your computer and use it in GitHub Desktop.
Save threedaymonk/05df4c3f6e4eb78684bd8d3ac73ff785 to your computer and use it in GitHub Desktop.
use_bpm 80
$t0 = Time.now
def elapsed
Time.now - $t0
end
def converge(period)
t = elapsed
t < period ? (period - t) / period : 0
end
def diverge(period)
1.0 - converge(period)
end
slumber = %i[ c e g a d ]
loop do
use_synth :prophet
with_fx :gverb, mix: 0.4 do
play slumber.pick,
pitch: rrand_i(-1, 1) * 12 + rand(3 * converge(60)),
cutoff: 70 + 40 * converge(120),
res: 0.3,
amp: 0.2,
pan: rrand(-1, 1),
sustain_level: 0.7,
attack: 3,
decay: 3,
release: 4,
duration: 8 + 8 * diverge(180)
end
sleep 1 + rand(7 * diverge(180))
break if elapsed > 180
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment