Re: How to print individual MusicTrack events?
Re: How to print individual MusicTrack events?
- Subject: Re: How to print individual MusicTrack events?
- From: William Stewart <email@hidden>
- Date: Mon, 26 Mar 2007 15:25:59 -0700
Look more closely at the types:
MusicEventIteratorGetEventInfo( MusicEventIterator inIterator,
MusicTimeStamp * outTimeStamp,
MusicEventType * outEventType,
const void ** outEventData,
UInt32 * outEventDataSize)
"type" will tell you which type of event it is (you use this to
interpret or cast the event data
"d" in your code below will be a pointer to the event data
"eventData" is the size (number of bytes) that "d" is pointing too
So, your print out is saying that your event data is 22 bytes long.
On 23/03/2007, at 7:36 PM, Yevgeniy Goldberg wrote:
Thanks Bill!
type=kMusicEventType_MIDIChannelMessage;
NewMusicEventIterator(track,&iter);
Boolean hasCurrentEvent;
MusicEventIteratorHasCurrentEvent(iter, &hasCurrentEvent);
while (hasCurrentEvent) {
MusicEventIteratorGetEventInfo(iter,&timeOfEvent,&type,&d,&eventData);
printf("Current music event: %d\n",eventData);
MusicEventIteratorNextEvent (iter);
MusicEventIteratorHasCurrentEvent(iter, &hasCurrentEvent);
}
and got this output:
Current music event: 22
I'm pretty sure I'm doing some basic things incorrectly.
I was desperately trying to find any working examples and failed.
What is the data type of myEvent should be?
Also, could you, please, point me to a proper usage example of
MusicTrackNewExtendedControlEvent?
What I'm trying to do is to read individual events as they occur and
insert instrument and.or bank change events in certain positions.
Probably just use the MIDIControl events to set bank and patch change
events
Bill
Your help is greatly appreciated.
-Eugene
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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