List of utility methods to do Midi File Save
void | saveMidiFile(File file) save Midi File try { int[] fileTypes = MidiSystem.getMidiFileTypes(sequence); if (fileTypes.length == 0) { System.out.println("Can't save sequence"); } else { if (MidiSystem.write(sequence, fileTypes[0], file) == -1) { throw new IOException("Problems writing to file"); } catch (SecurityException ex) { ex.printStackTrace(); } catch (Exception ex) { ex.printStackTrace(); |
void | saveMidiFile(Sequence sequence, String filename) Saves a Sequence to a file.
int[] fileTypes = MidiSystem.getMidiFileTypes(sequence); File file = new File(filename); MidiSystem.write(sequence, fileTypes[0], file); |