Patch p = getSelectedPatch();
SysexMessage[] msgs = getSelectedPatch().getMessages(); if (msgs == null) return;
    public void exportPatch(File file) throws IOException, FileNotFoundException {        if (!checkSelected()) return;        Patch p = getSelectedPatch();        FileOutputStream fileOut = new FileOutputStream(file);        fileOut.write(p.sysex);        fileOut.close();    }