Generating score files from midifiles with Ruby

Hi -- I'm new here, but I hope this might be of interest to some people. One thing I've never been particularly good at is creating interesting Score files to test Orchestras with, and it struck me that existing standard midifiles might be a good starting point.

I figured something for this ought to exist already, and searching the web turned up a link or two, but they all arrived at dead ends, so I wrote my own. The Ruby language seemed to be a natural medium for this (especially as I'd already written a midifile handling module).

The resulting ruby script should be able to create a score file from any standard midifile. Without options, it just uses Instrument numbers corresponding to MIDI channels, converting Note-On/Offs into equivalent start-times and durations, puts a scaled velocity into p4 and pitch ('pch' form) derived from the note into p5.

You can supply a "Map File" with the "-m" option that controls how channels and/or program numbers are translated to instruments, which gives some flexibility in warping an existing midifile into a suitable set of instruments.

I've put up a short web page for it (with downloadable zip and tgz archives) at:
http://www.GoodeveCA.net/midi2sco/

[URL moved 14 July 08]

This is cool, Pete, thanks.

This is cool, Pete, thanks. I've been wanting to have a tool like this for a while, and it's even better that it's written in Ruby.

midi2sco

Excellent! Glad it's useful to someone else.
I realize it needs some improvements eventually. In particular it always assumes timing is in seconds, rather than 'beats'. Guess it should have some way of scaling this. Any other suggestions will be noted (but no promises made... (:-)).

Super and very helpful Thanks

I will show it to my students in class today. Nice job. It will be very useful to all of them.

and me too!

Thanks for writing it and sharing it.

-dB

Thank you!

Thank you so much! I've recorded a lot of my keyboard work via MIDI, and was sort of reinventing the wheel, hand-coding a scorefile.

Then I hit on using a tool called MidiCSV to turn the midi file into a .csv file -- which can be edited in any spreadsheet. Saving the spreadsheet as tab-separated values (with a bit of formatting) gave me some nice results.

However, it looks like your program will 'cut out the middleman'. Nice work!

BTW, MidiCSV was written in Perl; your utility is written in Ruby; and the one I was working on this morning was written in Python ;-) I guess if we can just get a contender in Java, we're set :D

===
http://www.jamendo.com/en/artist/bruce.h.mccosar
http://bmccosar.wordpress.com/

Cool!

Really good to know that I've provided something others find useful!

I used a 'MidiCSV' quite a bit, too. Nice for quick jobs like removing sysex or something from a file. The version I have is in C, though. Maybe the author did more than one version.

Cheers,
-- Pete --

midi2sco

Hi Pete

Thanks for this utility. Worked without a problem on Vista.

As I also use Finale for instrumental composition - its midi output now makes it useful for csound composition.

Robert

thanks!

just wanna say Thanks for this script!!!!

z-pack Canadian pharmacy viagra cialis uk viagra uk generic viagra zpack Canadian pharmacy cialis online avanafil staxyn ed pills z pack buy zithromax viagra online cheap generic viagra z pak generic cialis kamagra uk z-pak buy viagra uk ed drugs pharmacy uk zpak