Re: Name of a music track
Re: Name of a music track
- Subject: Re: Name of a music track
- From: Craig Hopson <email@hidden>
- Date: Mon, 18 Sep 2006 10:16:21 -0600
On Sep 18, 2006, at 3:11 AM, Guillerminet Olivier wrote:
I'm doing a MIDI export using MusicSequenceSaveSMF().
I just would like to know how to give a name to each
music tracks in my music sequence. Thank you.
Try something like this:
// MIDI meta event types...
const UInt8 kMIDIMetaEvent_Text = 0x01; // just text. any
amount. should describe the track, however...
const UInt8 kMIDIMetaEvent_CopyrightNotice = 0x02; // something
like: (C)2005-2006 Red Rock Software, Inc.
const UInt8 kMIDIMetaEvent_TrackName = 0x03; // the name of the track
const UInt8 kMIDIMetaEvent_SequencerSpecific = 0x7F; // sequencer-
specific event
const UInt8 kMIDIMetaEvent_Test = 0xFA; // dummy event used for
self test methods
//... there are others defined in the MIDI standard
char* trackName;
MIDIMetaEvent* trackNameMetaEvent;
require_noerr( result = MusicSequenceNewTrack( _curSequence,
&_aTrack ), bailOnErr );
trackName = "SomeTrackName";
trackNameMetaEvent = (MIDIMetaEvent*)CFAllocatorAllocate
( kCFAllocatorDefault, sizeof( MIDIMetaEvent ) - 1 + strlen
( trackName ), 0 );
trackNameMetaEvent->metaEventType = kMIDIMetaEvent_TrackName;
trackNameMetaEvent->dataLength = strlen( trackName );
strncpy( (char* )trackNameMetaEvent->data, (const char* )trackName,
strlen( trackName ) );
require_noerr( result = MusicTrackNewMetaEvent( _aTrack , 0.0,
trackNameMetaEvent ), bailOnErr );
CFAllocatorDeallocate( kCFAllocatorDefault, trackNameMetaEvent );
Craig Hopson
Red Rock Software
***************************************************
"If every household in the U.S. replaced one light bulb with an
ENERGY STAR qualified compact fluorescent light bulb (CFL), it would
prevent enough pollution to equal removing one million cars from the
road." http://www.energystar.gov/index.cfm?c=cfls.pr_cfls
_______________________________________________
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