Created
May 5, 2020 07:06
-
-
Save 0atman/bfda10a19692289d67dcfb1d5648f998 to your computer and use it in GitHub Desktop.
Simple sonic pi metronome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
live_loop :metronome do | |
cue tick | |
128.times do | |
t = tick | |
bar = ((t - 1) / 4) + 1 | |
beat = (t - 4 * bar) + 4 | |
cue String(bar) + "/" + String(beat) | |
sleep 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment