Re: Timestamp & MyReadProc
Re: Timestamp & MyReadProc
- Subject: Re: Timestamp & MyReadProc
- From: Philippe Wicker <email@hidden>
- Date: Wed, 29 Jan 2003 20:49:00 +0100
On Wednesday, January 29, 2003, at 10:10 AM, Vigour Vigour wrote:
Can someone please tell me if timestamps are included in a midi
message that my MyReadProc recieves? How can I print them to my
project builder window? Just wants to look at them in a simple way.
Hi Vigour,
Your MIDIReadProc receives a MIDIPacketList pointer as an in parameter.
The MIDIPacketList contains, as its name implies, a list of MIDIPacket.
A MIDIPacket is a number of MIDI events (such as note on , note off...)
grouped under the same time stamp. All this is defined in
CoreMIDI/MIDIServices.h. The time stamp of each packet is set by the
sender, so it may not be always meaningful.
If the sender has used MIDISend:
If the sender wanted the MIDIServer to schedule the events, then the
time stamp is necessarily meaningful because it is the time used by the
MIDIServer to do the scheduling.
If the sender had no need to schedule the events, then it may set all
events with a time stamp 0 which tells the MIDIServer to immediately
deliver the events.
If the sender has used MIDIReceive:
In this case the user don't need a sheduling, events are to be send
immediately so the time stamp may not be meaningful.
As far as I know, the system does not modify the time stamp. So in
short, you will get what the sender has put in it.
Because I know you're interested in learning C language, here are 2
ways to display the time stamp:
- C style:
#include <stdio.h>
printf("time stamp %ld\n", the_packet_pointer->timeStamp) ;
- C++ style (using stream):
#include <stream>
using namespace std ;
cout << "time stamp " << the_packet_pointer->timeStamp << endl ;
Philippe Wicker
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.