Skip to content

Instantly share code, notes, and snippets.

@robbyrussell
Created December 4, 2015 23:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save robbyrussell/02a2e63bdf6a2bec228f to your computer and use it in GitHub Desktop.
Save robbyrussell/02a2e63bdf6a2bec228f to your computer and use it in GitHub Desktop.
Playing around with SoX
#!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