From: Joe E. <jo...@em...> - 2005-06-22 07:35:42
|
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 |