private void patchSwitchTest(Receiver synthRcvr, Instrument[] loadedInstrms, int onVel, int interSleepMsec) throws Throwable {
ShortMessage noteOnMsg = new ShortMessage();
ShortMessage progChangeMsg = new ShortMessage();
ShortMessage notesOffMsg = new ShortMessage();
for (int j = 0; j < 18; j++) {
for (int i = 0; i < 16; i++) {
int instIdx = (i + 16 * j) % (loadedInstrms.length);
Instrument tgtInst = loadedInstrms[instIdx];
Patch tgtPatch = tgtInst.getPatch();
int noteIdx = 59 + i;
int offVel = 0;
int timeStampImmediate = -1;
notesOffMsg.setMessage(ShortMessage.NOTE_OFF, i, noteIdx, offVel);
synthRcvr.send(notesOffMsg, timeStampImmediate);
getLogger().debug("Program change chanFromZ={} to {}", i, tgtInst);
progChangeMsg.setMessage(ShortMessage.PROGRAM_CHANGE, i, tgtPatch.getProgram(), tgtPatch.getBank());
synthRcvr.send(progChangeMsg, timeStampImmediate);
noteOnMsg.setMessage(ShortMessage.NOTE_ON, i, noteIdx, onVel);
synthRcvr.send(noteOnMsg, timeStampImmediate);
Thread.sleep(interSleepMsec);
}
}
}
private void drumkitsTest(Receiver synthRcvr, Instrument[] drumInstrums, int onVel, int interSleepMsec) throws Throwable {