Music ToolKit for Ruby
Classes for modeling music with a focus on simplicity. Support for reading/writing MIDI files and realtime MIDI.
gem install mtk
or download the source from here and add mtk/lib to your $LOAD_PATH. Then...
Some examples are available in the examples folder (more coming soon). The specs provide a lot of details of usage...
- Build musical generators to assist with composing music
- Re-implement Cosy (http://compusition.com/web/software/cosy) using these models as the "backend"
Alpha phase, API subject to change. Feedback welcome!
Ruby 1.8+ or JRuby 1.6+
MTK's core features should not depend on anything outside of the Ruby standard library.
MTK's optional features typically require gems. Currently the following gems are required:
MIDI file I/O requires the midilib gem
realtime MIDI I/O with (MRI/YARV) Ruby requires the unimidi and gamelan gems
realtime MIDI I/O with JRuby require the jsound and gamelan gems
The custom MTK syntax (work in progress) requires the citrus gem
Development requires the gems for optional features, plus the following:
- rspec (tests)
- yard (docs)
You shouldn't need to worry about the dependencies too much. A Gemfile is provided to sort this out for you:
gem install bundler bundle install
rvm is recommended for cross version testing (see Development Notes below)
Latest for source: http://rubydoc.info/github/adamjmurray/mtk/master/frames
Test with current version of Ruby:
Test with all supported versions of Ruby (requires rvm, MRI 1.8.7, YARV 1.9.2, and JRuby 1.6.3):
The spec:all test must pass for a pull request to be accepted or for a release of the mtk gem.
yard open doc/frames.html
or, to automatically refresh the documentation as you work:
yard server -r open http://localhost:8808
- Added realtime MIDI output for (MRI/YARV) Ruby
July 8, 2011: version 0.0.2
- Added a Sequencer module to build Timelines out of Patterns
- Overhauled Pattern module: removed type-specific patterns, and added the Palindrome, Lines, and Function patterns
- Patterns can now be nested (they can contain other Patterns)
- Patterns can now be typed, to distinguish Numeric Patterns as :pitch (i.e. intervals), :intensity, :duration, or :rhythm patterns
- Removed auto-sorting behavior from PitchClassSet to support 12-tone rows and atonal composition techniques
- Added #quantize and #shift features to Timeline
- Got rid of Chord class, model Chords with PitchSets or Arrays of Notes instead
- Added support for realtime MIDI I/O with JSound (JRuby only)
- various cleanup and reorganization
June 8, 2011: version 0.0.1
- First gem release.