Skip to content

Instantly share code, notes, and snippets.

@chrisboyle
Last active November 18, 2018 10:06
Show Gist options
  • Save chrisboyle/75d79bf4ff6ea98fbeb9b4e6230b28ba to your computer and use it in GitHub Desktop.
Save chrisboyle/75d79bf4ff6ea98fbeb9b4e6230b28ba to your computer and use it in GitHub Desktop.
Helpers for sonic-pi
# 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