Created
December 4, 2015 23:20
-
-
Save robbyrussell/02a2e63bdf6a2bec228f to your computer and use it in GitHub Desktop.
Playing around with SoX
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
#!env ruby | |
# | |
# brew install sox | |
# | |
def play(note, octave=1) | |
"play -q -n synth sq #{note}#{octave} remix - fade 0 .6 .1 norm; " | |
end | |
song_notes = %w(B A G A B B B A A A G D D B A G A B B B B A A B A G) | |
song = "" | |
song_notes.each do |note| | |
song << play(note, 5) | |
end | |
system(song) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment