Created
March 17, 2016 01:02
-
-
Save hopbit/fed94d0147097d7b667f to your computer and use it in GitHub Desktop.
ruby map & sort by example
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
# play it with Sonic Pi v.2.9 (http://sonic-pi.net) | |
notes = { dd: 74, c: 72, bbbbbbb: 83, ffff: 77, aaaaaa: 81, cccccccc: 84, eee: 76, ggggg: 79 } | |
notes.keys.map { | key | key.to_sym }.sort_by(&:length).each { |key| | |
play_pattern [notes[key]] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment