This is a Ruby gem to facilitate controlling MIDI devices using the MIDI Machine Control protocol.
- Implements the common MMC commands, including transport (stop, play, record, etc.) and track arming.
- Does not handle any command responses, whether status (like timecode) or errors.
- Does not implement full MMC specification.
require 'midi-mmc'
require 'unimidi'
# set up
midi_output = UniMIDI::Output.gets
mmc = MIDI::MMC.new(output: midi_output)
mmc.reset
# record
mmc.goto_zero
mmc.arm_tracks(1)
# record something here
mmc.stop
mmc.arm_tracks(nil)
# play back
mmc.goto_zero
mmc.play
Install as a gem:
gem install midi-mmc
...or add to your Gemfile
or .gemspec
file as needed.
MIDI::MMC is designed to work with the UniMIDI gem, although any object passed in the output
parameter to MIDI::MMC.new
that responds to the #puts
method can be used.