From: Hiroo H. <hir...@co...> - 2004-08-24 03:47:28
|
Jeff, I assumed that SysexMessage[] MidiUtil.byteArrayToSysexMessages() was used and I made a replacement for it. Sorry for confusing you. Jeff> I'm not sure I understand your message. I don't think Jeff> the problem is in the SysexSender but rather in the Jeff> SysexWidget.sendSysex method. To restate my original Jeff> message, first SysexWidget.sendSysex calls my generate Jeff> method. When the call returns, SysexWidget.sendSysex Jeff> calls setMessage(sysex, sysex.length). Because Jeff> setMessage expects a valid sysex string and not a CC Jeff> messages, it throws away the CC message and just Jeff> returns the 0xF0 and 0xF7 sysex delimiters. Does not SysexMessage.setMessage throw InvalidMidiDataException? It's interesting. Jeff> Are you suggesting adding something like the code Jeff> snippet you sent to the SysexWidget.sendSysex method? Jeff> Jeff> I suppose you could do something like check the first Jeff> byte of the data and if it's equal to 0xF0, call Jeff> setMessage, else have it continue through a case Jeff> construct and test for the various other types of MIDI Jeff> data. Is this what you're suggesting? The method I sent you returns an array of MidiMessage (if it works as I expect:-)). You can send each of them by using driver.send(). But as you see, the code which convert byte array into an array of MidiMessage is very inefficient. Driver can easily send short messages without using SysexSender by using one of Driver.send() methods now. I started thinking that it might be better to fix drivers which use SysexSender for non-sysex message. How did you list up the lots of drivers of the kind? -- Hiroo Hayashi |