Re: Time signature and meta events in MusicSequence
Re: Time signature and meta events in MusicSequence
- Subject: Re: Time signature and meta events in MusicSequence
- From: William Stewart <email@hidden>
- Date: Tue, 30 Mar 2004 10:10:41 -0800
The TimeSig events that are parsed from a MIDI file are put into the
tempo track - so you'd need to look there
Bill
On 29/03/2004, at 11:31 PM, A. Le Flanchec wrote:
>
Hello,
>
>
I am currently taking a look at the MusicSequence API. I have some
>
troubles reading meta events from standard MIDI Files. I don't get any
>
time signature meta event whatever I do... I checked my SMF in several
>
sequencers and all time signatures are there... What could I be doing
>
wrong ?
>
>
Below is the code I use.
>
>
Maybe it is related to the fact that I'm still under 0X 10.2.7 ?
>
>
Thank you in advance !
>
>
Vincent Le Flanchec
>
>
>
>
{
>
MusicSequence sequenceMIDI;
>
>
int i = 0;
>
>
//Initializing the musicSequence
>
char *filePath ="/Users/liris/bancal.mid";
>
OSStatus result = noErr;
>
FSRef fsRef;
>
>
result = FSPathMakeRef ((const UInt8*)filePath, &fsRef, 0);
>
result = NewMusicSequence(&sequenceMIDI);
>
FSSpec fsSpec;
>
result = PathToFSSpec (filePath, &fsSpec);
>
result = MusicSequenceLoadSMF (sequenceMIDI, &fsSpec);
>
>
>
//preparing for reading events
>
UInt32 MIDITrackNumber;
>
MusicSequenceGetTrackCount (sequenceMIDI, &MIDITrackNumber);
>
BOOL hasCurrentEvent;
>
MusicTimeStamp myTimeStamp;
>
MusicEventType myEventType;
>
const void * myData;
>
>
UInt32 MIDIDataSize;
>
>
//Reading events
>
while (i < MIDITrackNumber)
>
{
>
NSLog(@"trackNumber = %i", i);
>
MusicTrack track;
>
MusicSequenceGetIndTrack(sequenceMIDI, i, &track);
>
MusicEventIterator iter = 0;
>
NewMusicEventIterator (track, &iter);
>
>
MusicEventIteratorHasCurrentEvent (iter, &hasCurrentEvent);
>
>
while (hasCurrentEvent)
>
{
>
>
MusicEventIteratorGetEventInfo(iter,&myTimeStamp,&myEventType,
>
&myData,
>
&MIDIDataSize);
>
MusicEventIteratorNextEvent(iter);
>
MusicEventIteratorHasCurrentEvent (iter,
>
&hasCurrentEvent);
>
NSLog(@"timestamp = %f eventype %i", myTimeStamp,
>
myEventType);
>
>
if (myEventType == kMusicEventType_Meta)
>
{
>
NSLog(@" metatype %d",
>
((MIDIMetaEvent*)myData)->metaEventType);
>
}
>
>
}
>
>
if (iter) DisposeMusicEventIterator (iter);
>
++i;
>
}
>
}
>
>
_________________________________________________________________
>
MSN Messenger : discutez en direct avec vos amis !
>
http://www.msn.fr/msger/default.asp
>
_______________________________________________
>
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.
>
>
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
Culture Ship Names:
Ravished By The Sheer Implausibility Of That Last Statement
I said, I've Got A Big Stick [OU]
Inappropiate Response [OU]
Far Over The Borders Of Insanity And Still Accelerating [Eccentric]
________________________________________________________________________
__
_______________________________________________
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.