Java Utililty Methods Midi File Save

List of utility methods to do Midi File Save

Description

The list of methods to do Midi File Save are organized into topic(s).

Method

voidsaveMidiFile(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();
voidsaveMidiFile(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);