From: Michael H. <kor...@ya...> - 2009-08-25 02:00:57
|
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? 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. 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? 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; public KorgHAWK800SingleDriver() { super("Single", "Michael Hawkins"); sysexID = "F0422106*"; sysexRequestDump=new SysexHandler("F0 42 21 07 *patchNum* F7"); patchSize=262; 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) { //setBankNum(bankNum); try {Thread.sleep(250); } catch (Exception e){} 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)); } } |