Anyone having success using MusicPlayer?
Anyone having success using MusicPlayer?
- Subject: Anyone having success using MusicPlayer?
- From: Paul Messias <email@hidden>
- Date: Fri, 08 Mar 2002 20:35:42 -0500
I am trying to do something fairly simple with a MusicPlayer, but it doesn't
seem to work properly for me. I am just adding MIDI note events to a track,
in a sequence of a player.
I am sending the output to a MIDI Endpoint (which supposedly works now - or
so I heard...)
The events get added (I have iterated through the events on the track after
adding them, and they all show up with the proper information)
BUT - the player won't play.
Well almost - it's time rolls on, but only events that take place at or
before a timestamp of about 1 will play. Events with a duration longer than
about 0.44 don't stop playing (no note off is sent). (It leads to some very
short music...)
I have sent the output to an external MIDI synth using 2 different drivers
that both work fine with the other direct MIDI packet sending routines. I
have also sent the output to a virtual input on two different CoreAudio/MIDI
based apps. All tests result in the same problem.
This is driving me nuts, and I am wondering if it really just doesn't work
yet.
Any input would be great - sample code below:
OSStatus stat;
MusicPlayer aPlayer;
MusicSequence aSequence;
MusicTrack aTrack;
MIDINoteMessage aMessage;
MIDIEndpointRef aPlayerDestEndpoint;
aPlayerDestEndpoint = MIDIGetDestination(8);
stat = NewMusicPlayer(&aPlayer);
stat = NewMusicSequence(&aSequence);
stat = MusicSequenceNewTrack(aSequence, &aTrack);
stat = MusicPlayerSetSequence(aPlayer, aSequence);
stat = MusicSequenceSetMIDIEndpoint(aSequence, aPlayerDestEndpoint);
aMessage.channel = 0;
aMessage.note = 60;
aMessage.velocity = 125;
aMessage.duration = 1.0;
stat = MusicTrackNewMIDINoteEvent(aTrack, 1.0, &aMessage);
stat = MusicTrackNewMIDINoteEvent(aTrack, 5.0, &aMessage);
stat = MusicTrackNewMIDINoteEvent(aTrack, 10.0, &aMessage);
stat = MusicPlayerStart(aPlayer);
--
Paul Messias
Park Bench Software
(and Service)
http://www.parkbenchsoftware.com
_______________________________________________
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.