• 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
MIDI message timestamps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MIDI message timestamps


  • Subject: MIDI message timestamps
  • From: Chadwick Wood <email@hidden>
  • Date: Wed, 10 Nov 2004 20:53:14 -0600

Hi,

I've searched through the archives, and thought I understood how this works, but apparently I don't.

I'm trying to build a simple sequencer that will open a virtual MIDI source and send messages. I've gotten this to work somewhat, but I can't get the timestamps right. For now, I'm just sending two MIDI messages, that should be scheduled half a second apart. When I run the app, both messages are sent, and it looks like they're sent at the same time. Here's some of my code:

UInt64 startHostTime = AudioGetCurrentHostTime();
UInt64 nextTime = AudioConvertNanosToHostTime(AudioConvertHostTimeToNanos(startHostTime)+5 00000000);
timeStamp = startHostTime;
nextPacket = MIDIPacketListInit(&pktlist);
nextPacket = MIDIPacketListAdd(&pktlist, sizeof(pktlist), nextPacket, timeStamp, 3, NoteOn);
timeStamp = nextTime;
nextPacket = MIDIPacketListAdd(&pktlist, sizeof(pktlist), nextPacket, timeStamp, 3, NoteOff);



This uses 2 3-byte arrays, NoteOn and NoteOff, as the data for the messages. I figure I must be messing up the calculation of the timestamp, but I don't see how. Timestamps are in host time, right?


Thanks so much,
Chad Wood

_______________________________________________
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:
    • Re: MIDI message timestamps
      • From: Kurt Revis <email@hidden>
  • Prev by Date: Re: Multichannel configs etc.
  • Next by Date: Re: MIDI message timestamps
  • Previous by thread: Re: A few quick questions
  • Next by thread: Re: MIDI message timestamps
  • Index(es):
    • Date
    • Thread