Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to print individual MusicTrack events?



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:
http://lists.apple.com/mailman/options/coreaudio-api/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.