|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.columbia.ee.csmit.MidiKaraoke.examples.PianoRollExample
public class PianoRollExample
Shows how to get a PianoRoll from a midi file.
public static void main(String[] args) {
if(args.length == 0){
System.out.println("Usage: PianoRollExample [midi file name]");
return;
}
try {
File file = new File(args[0]);
Sequence mySeq = MidiSystem.getSequence(file);
PianoRoll roll = PianoRollViewParser.parse(mySeq);
NotesInMidi[] notes = roll.getNotes();
for(int i=1;i < notes.length;i++){
System.out.println(notes[i].toString());
}
} catch (Exception e) {
System.out.println("Problem!");
e.printStackTrace();
System.out.println(e.toString());
}
}
| Constructor Summary | |
|---|---|
PianoRollExample()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
Shows how to use the PianoRollViewParser to parse midi commands
in a PianoRoll. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PianoRollExample()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
PianoRollViewParser to parse midi commands
in a PianoRoll. Prints out the notes it read.
args - the command line arguments. The first (and only) argument
should be the name of a midi file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||