- (void)processMIDIPacketList:(const MIDIPacketList*)packetList
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
int i,j;
const MIDIPacket* packet;
uint8_t message[kBufferSize];
int messageSize = 0;
packet = packetList->packet;
for (i = 0; i < packetList->numPackets; i++)
{
for (j = 0; j < packet->length; j++)
{
if (packet->data[j] >= 0xF8) continue;
if ((packet->data[j] & 0x80) != 0 && messageSize > 0)
{
[owner handleMIDIMessage:message ofSize:messageSize];
messageSize = 0;
}
message[messageSize++] = packet->data[j];
}
packet = MIDIPacketNext(packet);
}
if (messageSize > 0)
[owner handleMIDIMessage:message ofSize:messageSize];
[pool release];
}
however i feel the midi handling is not as accurate as desired
can anyone please provide a better implementation
thank you for your support
abraços
nonnus