Problem with com.apple.audio.midi.MIDIPacketList
Problem with com.apple.audio.midi.MIDIPacketList
- Subject: Problem with com.apple.audio.midi.MIDIPacketList
- From: Gary Affonso <email@hidden>
- Date: Sat, 03 May 2003 17:21:49 -0700
I've been battling a problem all day today. I'm having trouble getting MIDI
data out through the Java CoreMIDI API's.
I've searched the net and looked through the list archives and found code
almost exactly like mine that is working for other folks. So at this point
I'm totally baffled as to what's going on.
Here's the problem.:
I setup a MIDI environment. (I assume I'm doing this part right because I
can register a listener and *capture* midi data from the port I'm interested
in.)
Here's my "send" routine:
MIDIData midiData;
MIDIPacketList midiPacketList = new MIDIPacketList();
midiData = MIDIData.newMIDIRawData(3);
midiData.addNoteOn(0, 40, 64);
// midiData.addRawData(0x90, 60, 127);
displayMIDIData(midiData);
midiPacketList.add(0, midiData);
displayPacketList(midiPacketList, "Added to packet list, ");
The problem is that this code leaves me with *empty* data in element #1 of
my MIDIPacketList.
I draw this "It's empty" conclusion because my displayPacketList routine
shows nothing when run above but works great to view incoming MIDI data
(MIDIPacketLists/MIDIData captured through a listener).
Curiously, if I follow the above code with another set of code that adds a
second note-off event to the MIDIPacketList, I *do* get something with data
in my packet list. The first item (inserted by the code above) remains
empty, but the second item actually has the note-off data.
I'm am *totally* perplexed why this is happening. Can anybody here shed
some light on this?
I've tried both Raw and Packet types for the MIDIData object as well as
using various methods of MIDIData to get the event data inserted. Using the
RAW packet type and the AddRawData methods seems to get me at least some
success (that second addition works) but there's still a big problem.
I'm running my code on 10.2.5 under 1.3 JVM to avoid having to do the
JDirect workaround.
Any help is very much appreciated.
- Gary
Server Side Software
5614 8th Ave NE
Seattle, WA 98105
Voice: (206) 525-4786
Fax: (413) 683-2973
Email: email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.