From: Brian <br...@ov...> - 2005-03-15 20:26:08
|
Steven Schmidt wrote: > Joachim Backhaus wrote: > >>> So can you tell me where in the code the locally (hard drive) stored >>> patch gets sent back to the synth? >>> >> >> >> Should be storePatch for permanent storage >> and sendPatch for temporary things >> >> > I was looking for a bit more info. I'm not sure what you mean by > permanent and temporary. If I edit a patch and want to send it back > to the synth, does store put it on the synth, and if so - can you > point me to the lines of code that should be sending the sysex > containing the patch to the synth? > Hello, Generally all interactions with the patches are local (hard drive). There are only three ways in which JSynthLib actually interacts with the synth itself. The first is the patch - > get menu option which will take a patch from the synth and store it in the local library The second is the patch -> store menu option which will take a patch from the current local library (on the hard disk) and send it to a user supplied location on the synth. This is used to "permanently" store a patch back to the synth. The synth will then keep the patch at that location. (usually even if the synth is turned off). The third is when you use patch -> send or patch -> play. This will send the patch from the local library on the hard drive to the synth, but rather than storing it in a particular location, the patch goes into the synth's "Edit Buffer" This is temporary storage for the currently edited patch. This is done so that the patch can be auditioned on the synth while you are working with JSynthLib.Here, we just overwrite the "Default" or "Current" Location. If the synth supports it we don't actually overwrite the patch permenantly. The actual code for storing or sending a patch is in Driver.java. Here basically sendPatch is declared to simply write the sysex contents of the patch directly to the device and storePatch is declared to set the bank and patch to the requested patch using patch change via MIDI and then calls sendPatch. For some synth models this works fine, but many require special messages for send and/or store and this does not work. In those cases the Driver for that synth will overwrite one of these methods. Send is here: //** * Set Device ID and send the sysex data to MIDI output. * @see #sendPatch(Patch) *// *protected* *final* *void* sendPatchWorker(Patch p) { *if* (deviceIDoffset > 0) p.sysex[deviceIDoffset] = (*byte*) (getDeviceID() - 1); send(p.sysex); } Store is here: //** * Sends a patch to a set location on a synth.<p> * Override this if required. * @see Patch#send(int, int) *// *protected* *void* storePatch(Patch p, *int* bankNum, *int* patchNum) { setBankNum(bankNum); setPatchNum(patchNum); sendPatch(p); Brian |