|
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Tuesday, February 12, 2002, at 08:59 , Joe Chang (l%l,m8) wrote:_______________________________________________<CoreMIDI/MIDIServices.h> says:
Since MIDI applications will tend to do a fair amount of
math with the times of events, it's more convenient to use a
UInt64 than an AbsoluteTime.
OK, but what is the format or unit (milliseconds?) of time-stamp in UInt64?
The paragraphs before the one you quoted:
@typedef MIDITimeStamp
@discussion A host clock time representing the time of an event, as
returned by AudioGetCurrentHostTime() (or UpTime()).
If I want to send a note-on message right now and note-off message after 1 second, what time-stamp values should I set for each MIDIPacket?
"Now" is most simply represented by a timestamp of 0.
The MIDITimeStamp for one millisecond from now is
const UInt64 kOneMillisecondOfNanos = 1000000;
MIDITimeStamp now = AudioGetCurrentHostTime();
MIDITimeStamp oneMillisecondFromNow = now +
AudioConvertNanosToHostTime(kOneMillisecondOfNanos);
Doug
| Home | Archives | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.