Results 1 to 2 of 2
Thread: Get MIDI Song Title
- 01-19-2011, 10:47 PM #1Member
- Join Date
- Jan 2011
- Rep Power
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);
- By Ben Wheatley in forum Advanced JavaReplies: 1Last Post: 08-05-2009, 05:58 PM
- By keffie91 in forum Advanced JavaReplies: 7Last Post: 10-06-2008, 07:21 PM
- By willemjav in forum Advanced JavaReplies: 77Last Post: 07-29-2008, 03:10 PM
- By leonard in forum New To JavaReplies: 1Last Post: 08-06-2007, 04:40 PM
- By ahlai in forum AWT / SwingReplies: 1Last Post: 07-24-2007, 02:57 AM