From: Peter G. <pet...@gm...> - 2009-08-25 09:30:17
|
Hmm, I forgot to "reply all", so Mike, sorry if you get this twice ;-) Anyway, I added some more thoughts .. On Tue, Aug 25, 2009 at 2:00 AM, Michael Hawkins <kor...@ya...>wrote: > Hi JSynthLib fans, > > Well, after hours (3 to be exact) of careful troubleshooting and tinkering, > I was able to pull in a patch from my Korg Poly-800. > > But as with most things in life, I now have more questions than I started > with. I am hoping that someone who has more experience with JSynthLib than > me can help me out. > > To get the patch "get" and "paste" to work required that a) I set sysexID = > "F0422106*"; this is the header for a patch dump coming from the Poly-800. > and b) that I comment out sending a bank change in requestPatchDump. > > The Poly-800 sends an acknowledgement sysex message after it receives a > bank change. So the "Get" code seems to have choked on the 7 bytes that it > receives just prior to receiving the patch sysex message itself. > > So, I could just rewrite the sysex implementation on the Poly-800 so that > it doesn't send an acknowledgment sysex message but that seems to be a bit > of a cop out and especially so if there is a way that I could rewrite the > requestPatchDump so that it would intercept that ack. message and ignore it > instead of choking on it? Maybe you should to make the KorgHAWK800SingleDriver extends *BankDriver*, like I did with my SPD11PatchDriver<http://spd-11.wikispaces.com/SPD11PatchDriver>, and use a 'bankChangeDriver' and 'K800SingleDriver', like I used a SPD11PadDriver and SPD11SettingsDriver. I'm not really understanding the difference between a singleDriver, bankDriver, converter I'm reading the programmer's guide again, and I'm wondering if a Single Patch really is a *set of* sysex messages like described there<http://jsynthlib.svn.sourceforge.net/viewvc/jsynthlib/trunk/JSynthLib/doc/programming.html#areas>. I first thought a Single Patch would hold just one Single SysEx Message. Because a single patch of my drumsynth is composed of 32 sysexmessages describing each drumpad + 1 sysexmessage describing the effects and pedal settings. In your case a patch is 1 bank ack sysexmessage + a 262 bytes patch sysexmessage > > > Now, I don't want to be too pushy here because I like JSynthLib and I like > the idea of an open source patch editor but hopefully someone on this list > can answer a question or two because it has taken me hours to get this far > and I have many more questions that need answering. Four hands do three times more work than two hands, I guess it's good to ask questions to many heads too, instead of keeping the questions for yourself. > > > Here is another question, the Poly-800 does not support patch names in its > sysex implementation nor programming but does that stop me from using patch > names in JSynthLib itself? Is it possible to save patch names outside of the > sysex message but inside the patch when stored in JSynthLib? My drum kits are named numbers 1~64, and I'd like to give 'em names too, so I actually have the same question. I think maybe we should take a look at how e.g. the TD-6 driver stores settings for padInfo<http://jsynthlib.svn.sourceforge.net/viewvc/jsynthlib/trunk/JSynthLib/synthdrivers/RolandTD6/PadInfo.java?view=markup>in the prefs file, it keeps info about if a pad is active or not, look at how it's done in RolandTD6Device<http://jsynthlib.svn.sourceforge.net/viewvc/jsynthlib/trunk/JSynthLib/synthdrivers/RolandTD6/RolandTD6Device.java?revision=646&view=markup>(line 56 & 75). The same trick may work to keep patch names in a preferences.node("Name(s)") > > > Anyway, in advance, I would like to thank anyone that might provide me with > some assistance. > > If I don't hear anything from anybody, I may have to consider an > alternative to JSynthLib because the learning curve might be just too steep > while going at this completely alone. > > Here's my singledriver below: > > /* > * @version $Id: KorgHAWK800SingleDriver.java 111 2009-08-20 04:05:40Z > hawkins $ > */ > package synthdrivers.KorgHAWK800; > > import core.Driver; > import core.ErrorMsg; > import core.JSLFrame; > import core.Patch; > import core.SysexHandler; > > public class KorgHAWK800SingleDriver extends Driver > { > private int curBank = 0, curPatch = 0; You don't use these variables anywhere ? > > public KorgHAWK800SingleDriver() { > super("Single", "Michael Hawkins"); > sysexID = "F0422106*"; > sysexRequestDump=new SysexHandler("F0 42 21 07 *patchNum* F7"); > > patchSize=262; This is why it chokes on the first returned ack message > > deviceIDoffset=-1; > > bankNumbers = new String[] { > "0-Bank1", "1-Bank2","2-Bank3", "3-Bank4" > }; > // patch numbers use octal representation with no zeroes (11-88) > patchNumbers=new String[] {"11","12","13","14","15","16","17","18", > "21","22","23","24","25","26","27","28", > "31","32","33","34","35","36","37","38", > "41","42","43","44","45","46","47","48", > "51","52","53","54","55","56","57","58", > "61","62","63","64","65","66","67","68", > "71","72","73","74","75","76","77","78", > "81","82","83","84","85","86","87","88"}; > } > > public void setBankNum(int bankNum) > { > try { > send(new byte[] { > (byte)0xF0,(byte)0x42,(byte)0x21,(byte)0x0E, > (byte)bankNum,(byte)0xF7 > }); > } catch (Exception e) {} > } > > public void requestPatchDump(int bankNum, int patchNum) { Maybe here add patchSize = SIZE_OF_ACK; //the number of bytes that comprise the returned ack message patchNameSize = 0; > > //setBankNum(bankNum); uncomment > > try {Thread.sleep(250); } catch (Exception e){} and now set patchSize = SIZE_OF_PATCH; //the number of bytes that comprise the returned patch message > > byte sysex[] = { > (byte)0xF0, (byte) 0x42, (byte) 0x21, (byte) 0x07, > (byte)patchNum, (byte) 0xF7 > }; > send(sysex); > } > > public void storePatch (Patch p, int bankNum,int patchNum) > { > setBankNum(bankNum); > try {Thread.sleep(250); } catch (Exception e){} > //patchNum=patchNum&0x3F; > ((Patch)p).sysex[4]=(byte)patchNum; > sendPatchWorker(p); > setPatchNum(patchNum); > } > > public void sendPatch (Patch p) > { > byte [] newsysex = new byte[262]; > System.arraycopy(((Patch)p).sysex,0,newsysex,0,262); > newsysex[4] = (byte)(0x40); > try { > send(newsysex); > }catch (Exception e) {ErrorMsg.reportStatus(e);} > } > > public Patch createNewPatch() > { > byte [] sysex = new byte[262]; > sysex[0]=(byte)0xF0; sysex[1]=(byte)0x42; sysex[2]=(byte)0x21; > sysex[3]=(byte)0x06; sysex[261]=(byte)0xF7; > Patch p = new Patch(sysex, this); > //setPatchName(p,"NewPatch"); > calculateChecksum(p); > return p; > } > > protected void calculateChecksum(Patch p,int start,int end,int ofs) > { > // no checksum > } > > //public JSLFrame editPatch(Patch p) { > // return new KorgHAWK800SingleEditor((Patch)p); > protected JSLFrame editPatch(Patch p) { > return (new synthdrivers.Generic.HexDumpEditorFrame(p)); > } > > } > It would be easier to help if you added more //comments to explain what's happening and why. |