Midi Tools
Version 2
(May 2009)
Version 2 of the tools have moved and are here. I have extended the tools
quite a bit.
Version 1

Make sure your version of Matlab has a recent enough java runtime environment. At the matlab prompt, type
version java
. Matlab should say at least Java 1.5.0. I think that Matlab R14 and later should work.

Download midiToolboxNM.m
and KaraokeMidiJava.jar. midiToolboxNM is a wrapper for the java code and can be called just like read_midi.m.

Tell Matlab where the jar is by editing
classpath.txt
.

At the matlab prompt, type
edit classpath.txt
.

Add a line at the end telling Matlab the location of the jar:
/<pathtojar>/KarokeMidiJava.jar
,
where <pathtojar> is the path to wherever you have saved
KaraokeMidiJava.jar. Obviously, if you are running Windows, use a
Windowsstyle path.

Save classpath.txt and restart Matlab. (Matlab only reads classpath.txt at startup.)

At the Matlab prompt, type
nm = midiToolboxNM('<name_of_file.mid>');
,
where <name_of_file.mid> is the name of the midi file you want to
read. The nm variable will now have a notematrix just like the
one defined in MidiToolbox.
