Last active
November 18, 2018 10:06
-
-
Save chrisboyle/75d79bf4ff6ea98fbeb9b4e6230b28ba to your computer and use it in GitHub Desktop.
Helpers for sonic-pi
This file contains hidden or 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
# riff(:c4, '5313555 333 555 ') | |
def riff(tonic, melody) | |
t = note(tonic) - 1 | |
ring(*(melody.split('').map {|c| n = c.to_i; n.zero? ? :r : note(t + n)})) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment