From: Gord W. <gw...@dc...> - 2005-06-22 07:12:11
|
I'm working on a driver for the Korg M1, working from the latest downloaded release (cvs wouldn't let me in..). I'm still learning the ropes, so forgive the stupid questions: Things are not working just yet, and it seems to be the following: Trying out a "get" patch from the gui fails. JSYnthLib is sending out a string of commands to set the bank number, patch number etc as I set up in the KorgM1SingleDriver.java file I'm working on. (I copied KorgX1 stuff and started modifying). The problem seems to be that for each sysex command sent to the M1, it responds with a Sysex message back, so when JSYnthLib goes to read a patch dump sysex message from the message queue, it gets all these other responses first, and fails to find the actual sysex patch. I think also that the M1 is expecting a message by message handshake, and the way the X1 driver was structured, it just fires the batch of sysex commands all at once. I think the M1 can't keep up. So, my question is, can I somehow drain out the sysex responses as they arrive, using a get command somehow from inside my KorgM1SingleDriver class? I would like to actually test the responses. The code would go something like this: send(sysex message to set bank) waitfor (sysex message that says that worked) send(sysex message to set patch number) wait for( sysex message that says patch number setting worked, error if not, yadayada..) Etc. This way the extra messages are drained, and tested, and the handshake slows down the whole works so the M1 can keep up... Any pointers, or perhaps other synth drivers that use this idea? Cheers, Gord Wait (ps I'm waiting for my email to join the discussion group..) |
From: <Gor...@ne...> - 2005-06-22 18:26:14
|
Hi Joe, sounds like what you are working on is what I need to make things work. For now (to debug) I'll comment out the set patch/bank/etc sysex messages that are sent to the M1 so that it won't send back all the handshake stuff and mess up what I'm working on... Cheers, Gord __________________________________________________________________ Switch to Netscape Internet Service. As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register Netscape. Just the Net You Need. New! Netscape Toolbar for Internet Explorer Search from anywhere on the Web and block those annoying pop-ups. Download now at http://channels.netscape.com/ns/search/install.jsp |
From: Joe E. <jo...@em...> - 2005-06-23 22:30:21
|
Gor...@ne... wrote: >Hi Joe, sounds like what you are working on is what I need to make things work. > Well, until you're able to download from CVS, it makes no sense for me to upload my changes. >For now (to debug) I'll comment out the set patch/bank/etc sysex messages > I think all you have to do is override requestPatchDump. The default one (in Driver) sends a bank change, then a patch change, and then uses your sysexRequestDump (if it's defined) to request the patch. - Joe |
From: Joe E. <jo...@em...> - 2005-06-22 07:35:42
Attachments:
smime.p7s
|
Gord Wait wrote: > The problem seems to be that for each sysex command sent to the M1, it > responds with a Sysex message back, Well, you usually send a single-sysex "request" and get a single-sysex "response".... for single patches, anyway. Is this not what you're getting? > so when JSYnthLib goes to read a patch dump sysex message from the > message queue, it gets all these other responses first, and fails to > find the actual sysex patch. The "Get Patch" dialog empties the input queue right before it sends the request. So, any sysex messages that you see should be as a direct result of the request you sent. > I think also that the M1 is expecting a message by message handshake, There are a few other synths that prefer this... and, sadly, it looks like JSL doesn't support this yet. Take heart, though... it's going to. I'm working on it. > and the way the X1 driver was structured, it just fires the batch of > sysex commands all at once. I think the M1 can't keep up. Oh... I think I see what you're saying now. When requesting multiple patches, JSL needs to "pace" itself so that each next request happens after the response from the previous request has come in, right? If so... then I've got two things to say: 1 - I've written an improvement for JSL that will allow you to do this (basically, its a way for any class to ask to be notified any time a sysex message arrives). I haven't committed it to cvs yet, because it's kind of a major change to how sysex messages are passed in JSL, and I wanted to make sure that there aren't any bugs in it. However, since the cvs traffic has been nil for the past couple of months, I'm not sure anyone would notice even if I *did* break something. 2 - I thought you were working on a SingleDriver (ie, send/receive single patches). If so, what's with sending out multiple requests? > So, my question is, can I somehow drain out the sysex responses as > they arrive, using a get command somehow from inside my > KorgM1SingleDriver class? Not yet.... not that I know of. > I would like to actually test the responses. The code would go > something like this: > > send(sysex message to set bank) > waitfor (sysex message that says that worked) > send(sysex message to set patch number) > wait for( sysex message that says patch number setting worked, error > if not, yadayada..) Actually, the way I've written it, it would be more like... you make a thread which sends the requests, one at a time. Each time it sends one, it pauses itself. Then, another method in the class would get called by the low-level midi receive stuff whever a midi message came in. Your method would inspect it and, if it was what you were expecting, then it tells your sender-thread to continue for another loop. If it wasn't what you expected, then your method would abort the sender thread. I guess it would be easy enough to wrap this into a "waitFor" method, though. - Joe |