Processing midifiles with Ruby

P

Pete

If anyone else has a need to handle standard midifiles with Ruby
they might be interested in a little package I've written for that
purpose.

A little while back I found I was doing a lot of analysis of some
particular midifiles. Typically I was using one of the midifile->text
packages and then running a ruby script on the result, but those
extra text files became an annoyance, and I figured it would be better
to read the midifiles directly with Ruby.

I found Jim Menard's 'midilib' quickly, but it seemed both more and
less than I needed. ('Less' in particular because it doesn't handle
Format 0 files, and those were what I was looking at then.) So [of
course!] I ended up writing a library to suit myself. I've finally
cleaned it up and added a bit of documentation, so I'm making it
available in case it's useful to others.

It provides facilities for both reading and writing all types of midifiles.
Reading is particularly simple -- you simply create a Midifile object with
the opened file as a parameter, and use its 'each' method to extract
every element of the file in sequence. Building a new file for writing
is also straightforward. The package includes a few demo scripts to
illustrate its usage.

I've put the package up on the web at:

http://jwgibbs.cchem.berkeley.edu/pete/midifile_rb/

Cheers,
-- Pete --
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top