midi2sco

— v1.1   August 2010 (fixed for Ruby 1.9) —

midi2sco is a Ruby script to generate 'Score' commands for Csound from a standard midifile. Either all channels in the source can be translated to Instrument commands, or — using a Map File — selected channels and/or Program Numbers may be directed to particular instruments. Start-time ('p2') and Duration ('p3') are derived from the MIDI Note-Ons and Note-Offs. Amplitude and Pitch specification are computed from Note Velocity and Pitch; these are normally 'p4' and 'p5' respectively, but their order can be reversed. This version also has the option of using a number of subinstances of an instrument ("i1.1" or the like) for instruments that hold their activation beyond the end of a note in the score. See the README in the package for all details.

Requirements: The script runs under the Ruby interpreter, which must be installed on your machine. Probably should be version 1.8.4 or later. It should work under any OS — let me know if it doesn't!
The 'midifile.rb utility script is also needed, but included in the downloadable packages. [Please note -- Until 2010 Aug 29, midifile.rb as supplied wouldn't work in Ruby 1.9 (because of a drastic change they made!). Both midifile.rb and midi2sco itself (because of a minor incompatibility) have been updated to run under both 1.8 and 1.9. ]

The downloadable archives below contain the following:

midi2sco
The script itself — see the README for usage.
midifile.rb
The midifile reading module — install anywhere in your Ruby library path. A fuller package of this (with README and examples) can be found here.
README
How to use the script.

Downloads:

You can download the package here:
midi2sco.tgz — gzipped tar, 11.5 KB
midi2sco.zip — zip archive, 13.5 KB

Author:

                                Pete Goodeve
                                Berkeley, California

                e-mail: pete@GoodeveCa.NET
                         pete.goodeve@computer.org

Programs for BeOS
My Home Page