Announcing MIDIator
I was just looking at my FeedBurner statistics and noticed that my feed readership has gone up by approximately 100 in the past year. Then I looked at my blog and realized I hadn’t posted anything Ruby-related in 2008. Then I remembered that I’m a Ruby programmer and decided to release some software for the express purpose of blogging an announcement.
Okay, not really. Well. The last part is mostly a lie. I guess. On to the point.
Background
Earlier this year a small publishing concern called Apress (that you may have heard of!) published a most interesting book. It was Practical Ruby Projects, by the lovely and talented Topher Cyll. There’s a link on his page if you want to get it.
Practical Ruby Projects is the book that I have always wanted to write. I would have called it Stupid Ruby Tricks myself, but that’s neither here nor there. The subtitle is “Ideas for the Eclectic Programmer”, and that really gives you an idea of the flavor of what’s inside.
The second chapter is entitled “Making Music with Ruby”, and is a gentle introduction into writing code that can play music. The chapter is based around building an app that can play songs written in simple notation. One of the really awesome things that Topher did, though, was to supply code to interface with the MIDI subsystems on Windows, Linux, and OSX.
Around this same time, Giles Bowkett’s sweet project Archaeopteryx was starting to take off. Giles had also taken both code and inspiration from Practical Ruby Projects, but he had only grabbed the OSX parts. That’s fine, I thought, because I’m on a mac and it works for me.
Then, people started complaining. Not really complaining, but definitely whinging about wanting to play with Archaeopteryx but being stuck on inferior platforms. There was also an issue with the fact that Giles demos Archaeopteryx hooked up to Reason, and Reason costs like $500. You don’t have to use Reason, though, as Shay Arnett so deftly demonstrated at the Hoedown. I have more to say about this, but you’re going to have to wait for RubyConf.
Aaaaaanyway, I decided that I was going to take Topher’s code and bundle it up for you, the masses, to consume. This was made possible in large part by Apress’s total awesomeness in releasing all the code from Practical Ruby Projects under the MIT license. I took his code, refactored it a little bit, wrote some specs and examples, and published it as MIDIator.
How Can
First, install as normal:
$ sudo gem install midiator
Next, do this:
1 2 3 4 5 6 |
require 'rubygems' require 'midiator' midi = MIDIator::Interface.new midi.autodetect_driver midi.play( 84, 0.5 ) |
Thanks to Tobi Reif for pointing out the error in the above example!
You should hear a half-second of middle C. Now, to be fair, I’m leaving out all the information about how to get a working MIDI setup on your machine. I’ll be blogging about that later, though, so if you don’t know how just keep your eyes peeled.
Where Can I…
You can get MIDIator at GitHub or RubyForge, or install it via gems as shown above.
Future blog posts about MIDIator will be tagged, so you can use this link to get all the news that’s fit to blag.
You can read the RDoc at RubyForge.
Stay Tuned!
There’s more coming. In the next few days I’ll be showing you how to get MIDI working on your system. Then I’ll be speaking at RubyConf with Giles and Yossef Mendelssohn. I’ll definitely post some stuff related to my talk around the conference, but you’re going to have to wait for the really fun stuff.
- Company:
- Operating System:
- Person:
- Programming Language:
- Tags:
- Ruby Tricks,
- osx,
- ruby,
- github
- Technology:


Recent comments
1 year 23 weeks ago
1 year 23 weeks ago
1 year 25 weeks ago
1 year 27 weeks ago
1 year 42 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 46 weeks ago
1 year 48 weeks ago