Get MIDI Song Title
I am working on a Java MIDI visualizer and I currently would like to pull the title from a sequence, but I can't seem to find any method in the API between the Sequence, Sequencer, or anything else that will return the title to me.
Anyone know how to get a hold of this information?
I'm not familiar with Java's midi capabilities, but one thing that looks promising in the API is that MidiSystem has a static method, getMidiFileFormat that extracts the MidiFileFormat from a Midi File, and MidiFileFormat has a getProperty method that takes a String and returns an Object, including a String object, the title of the file, if you pass the String "title" into this method. So in other words, what if you try something like so...
// assuming myMidiFile is the midi file of interest,...
String title = MidiSystem.getMidiFileFormat(myMidiFile).getProperty("title").toString();
System.out.println("Midi title is: " + title);