Ruby-RtMidi

Ruby wrapper for RtMidi, a cross-platform C++ library for realtime MIDI input and output.

Features:

  • List MIDI I/O ports
  • Send 3-byte MIDI messages to output ports
  • Listen for 3-byte messages on input ports

In other words, it can handle channel messages (notes, control change, pitch bend, pressure, program), but there is no support for SySex messages yet.

Supported Platforms:

Requirements

To install, you need gcc and g++ on your PATH.

On Windows, you can use Visual Studio's cl.exe compiler instead.

Here's the recommended approach for your system:

OS X Setup

  • Install XCode via the Apple AppStore.
  • Open XCode's Preferences and install "Command Line Tools" in the Downloads tab.

See this stackoverflow discussion for help.

Windows Setup

with Visual Studio (cl.exe)

  • Install Visual Studio (Tested with Visual C++ 2010 Express. Any recent version with a C++ compiler should work.)
  • Use the "Visual Studio Command Prompt" to install

with MinGW (gcc/g++)

  • Install MinGW
  • During installation, on the "Select Components" screen, install the following:
    • C Compiler
    • C++ Compiler
    • MSYS Basic System
    • MinGW Developer ToolKit
  • Use the the MinGW Shell (MSYS) to install

Linux Setup (Ubuntu)

sudo apt-get install g++
sudo apt-get install jackd
sudo apt-get install libjack-dev

Installation

Assuming you have Ruby installed, and are ready to compile C++ code with gcc, this part is easy:

gem install rtmidi

Usage

See the following examples:

Documentation

http://rdoc.info/github/adamjmurray/ruby-rtmidi/frames

Changelog

  • 0.2.2 - Compilable with Visual Studio on Windows
  • 0.2.1 - Linux support (thanks to @quark-zju)
  • 0.2 - First stable release