Learn Music through Ruby!
Based on my presentation at MtnWest Ruby Conference.
Add this line to your application's Gemfile:
gem 'music_theory'
And then execute:
$ bundle
Or install it yourself as:
$ gem install music_theory
Make sure that you have mplayer installed as well, as output requires it:
brew install mplayer
Play any of the sample songs by running them with ruby
ruby samples/arpeggios.rb
require 'music_theory'
Make new notes
MusicTheory::Note.new
Play Notes
MusicTheory::Note.new.play
Create scales
MusicTheory::Scale.new
Play Scales
MusicTheory::Scale.new.play
Play chords
MusicTheory::Scale.new.chord.play
Play third
MusicTheory::Scale.new.third.play
Play arpeggios
MusicTheory::Scale.new.arpeggio.play
- Fork it ( https://github.com/[my-github-username]/music_theory/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- URUG community
- Alex Speller (for indirect inspiration)