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

  1. Make sure your version of Matlab has a recent enough java run-time 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.
  2. Download midiToolboxNM.m and KaraokeMidiJava.jar. midiToolboxNM is a wrapper for the java code and can be called just like read_midi.m.
  3. Tell Matlab where the jar is by editing classpath.txt .
    1. At the matlab prompt, type edit classpath.txt .
    2. Add a line at the end telling Matlab the location of the jar: /<path-to-jar>/KarokeMidiJava.jar , where <path-to-jar> is the path to wherever you have saved KaraokeMidiJava.jar. Obviously, if you are running Windows, use a Windows-style path.
    3. Save classpath.txt and restart Matlab. (Matlab only reads classpath.txt at startup.)
  4. 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.