• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MIDI packet processing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MIDI packet processing


  • Subject: Re: MIDI packet processing
  • From: Doug Wyatt <email@hidden>
  • Date: Mon, 13 Sep 2004 14:25:29 -0700

On Sep 13, 2004, at 14:12, X. J. Scott wrote:
For example, if I slide my finger from one held key across to another
key, the accompanying MIDI data might be a note off, a note on, and an
updated channel pressure. Should those each be their own call to
MIDIPacketListAdd or can they be combined?

I think they can be combined since there is one time associated with them,
HOWEVER you may not want to do this since they can theoretically get reordered
by the MIDI driver if they happen at the same time and you may want to prevent
the note-on from being sent before the note-on in order to avoid special
legato processing on the synth. Better to have the note on sent a tick or two
later.

Actually, I think and hope I am wrong on this one since I never parse
MIDIPackets to have more than one MIDI event and if they do I'm just tossing
out info. I assume one event per packet, multiple events per PacketList.
Multiple events per Packet is probably asking for trouble. Try it and see
what happens though and let us know. Myself, I only even put one event per
packet.

Multiple events per packet ARE allowed. You WILL receive them (e.g. from a USB MIDI interface) and you may create them.


Just don't use running status when writing a packet, or put realtime in between the bytes of a non-realtime message (except sysex). And you can make those assumptions when you parse packets.

You can call MIDIPacketListAdd to add multiple MIDI messages to one packet, e.g.:

Byte msgs[] = { 0xB0, 0x07, 0x7F, 0x90, 0x3C, 0x40 }; // volume 127, note-on middle C
MIDIPacketListAdd(pktlist, listSize, curPacket, timeStamp, 6, msgs);


The events will be scheduled with the same timestamp -- and ordering will be preserved.

Doug

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Multiple events per packet
      • From: "X. J. Scott" <email@hidden>
References: 
 >Re: MIDI packet processing (From: "X. J. Scott" <email@hidden>)

  • Prev by Date: Re: MIDI packet processing
  • Next by Date: Re: bug in VST2AU SDK, was: Re: AUValidation Error
  • Previous by thread: Re: MIDI packet processing
  • Next by thread: Multiple events per packet
  • Index(es):
    • Date
    • Thread