Control MPlayer with MIDI
Switch branches/tags
Nothing to show
Clone or download
Latest commit 5baa55c Jun 8, 2017
Failed to load latest commit information.
examples more explanation May 7, 2015
lib use send Jun 8, 2017
test use assert nil Jun 8, 2017
Gemfile add Gemfile Apr 22, 2015
LICENSE update dates Mar 10, 2017 formatting May 19, 2017
Rakefile add Rakefile Apr 22, 2015



Control MPlayer with MIDI

MPlayer is a free, cross-platform, command-line driven, highly configurable, (often) GUI-less open-source media player.

Enabling MPlayer to be controlled by MIDI opens up a host of possibilities for live video performance, media automation and more

This project provides a Ruby DSL to define realtime interactions between MIDI input and MPlayer


You'll need to install MPlayer before using this. That can usually be accomplished with a package manager eg brew install mplayer depending on what OS you're using.

This project itself can be installed as a Ruby Gem using

gem install mmplayer

Or if you're using Bundler, add this to your Gemfile

gem "mmplayer"


require "mmplayer"

@input = UniMIDI::Input.gets

@player =, :mplayer_flags => "-fs") do

  rx_channel 0

  system(:start) { play("") }

  note(1) { play("") }
  note("C2") { play("") }

  cc(1) { |value| volume(:set, value) }
  cc(20) { |value| seek(to_percent(value), :percent) }

  eof { puts "finished" }



An annotated breakdown of this example can be found here

The MPlayer Man Page has a full list of MPlayer startup flags

All MPlayer runtime commands enabled by the mplayer-ruby project are available here too. (eg seek and volume in the example above). The RDOC for mplayer-ruby has a full list of runtime commands


Apache 2.0, See LICENSE file

Copyright (c) 2015-2017 Ari Russo