public void requestPatchDump(int bankNum, int patchNum) { send( SysexRequestDump.toSysexMessage( getChannel(), new SysexHandler.NameValue("bankNum", (bankNum * 100 + patchNum) % 128), new SysexHandler.NameValue("patchNum", (bankNum * 100 + patchNum) / 128))); }
/** Request single patch dump. GP-16 requires correct checksum. */ public void requestPatchDump(int bankNum, int patchNum) { try { Thread.sleep(sleepTime); } catch (Exception e) { } SysexHandler.NameValue nVs[] = new SysexHandler.NameValue[2]; nVs[0] = new SysexHandler.NameValue("patchnumber", bankNum * 8 + patchNum); nVs[1] = new SysexHandler.NameValue("checksum", 0); Patch p = new Patch(SYS_REQ.toByteArray(getChannel(), nVs)); calculateChecksum(p, 5, 10, 11); // the gp-16 requires correct checksum when requesting a patch send(p.sysex); try { Thread.sleep(sleepTime); } catch (Exception e) { } }