Re: Sequence and Graph (was coreaudio-api digest, Vol 2 #239 - 3 msgs)
Re: Sequence and Graph (was coreaudio-api digest, Vol 2 #239 - 3 msgs)
- Subject: Re: Sequence and Graph (was coreaudio-api digest, Vol 2 #239 - 3 msgs)
- From: Bill Stewart <email@hidden>
- Date: Mon, 09 Sep 2002 10:49:06 -0700
on 7/9/02 1:34 AM, Craig Bakalian wrote:
>
Hi Luke,
>
Yes, I understand this. Yet my app is going to loop through the
>
MIDISetup.getNumberOfSources(); and establish a list box for the user to
>
select blah, blah, blah... I was hoping to make an algorithm in the
>
play button, or before the play button that configures the created
>
sequence to send data to either javax.sound.midi, an AUGraph,
>
MusicPlayer, and midi hardware on usb ports. So, how does the
>
MidiSequence.setAUGraph(AUGraph inGraph) and
>
MidiSequence.setMIDIEndpoint(MIDIEndpoint inEndpoint) work. Are they
>
for receiving midi data into the sequence's tracks or sending data from
>
the sequence's tracks?
>
I realize that I can skip the AUGraph and send data to the
>
MusicPlayer now. But what about sending data from a MidiSequence to and
>
Endpoint?
The setAUGraph calls tells the sequence that any of its events should be
addressed to the AUGraph you set. (Actually, the sequence directs events to
AudioUnits, so in this case, the graph looks for the first MusicDevice node
in the graph and directs all of the sequence's tracks to that node)
Same for the endpoint, but in this case of course the events are directed to
an endpoint.
You can't skip the AUGraph/Endpiont. The MusicPlayer is JUST a transport
control mechanism for playing a sequence. A MusicSequence is a collection of
music events in MusicTracks.
Then, either the AUGraph of the MIDIEndpoint become the targets for the
events in the sequence, which when played are rendered by either of these
two targets.
(As an added layer of flexibiility, you can address different tracks in a
sequence to different AUNodes (or MIDIEndpoints). And of course, MusicEvents
can be more complex structures than MIDI (but in that case, you can then
only direct events to AUNodes - for instance, check out the Parameter
Events.
When you create a Sequence from a MIDI file it creates a default graph for
you with a MusicDevice node and that is what makes the "noise" when you play
it. This happens for you, but the mechanism is still the same.
Bill
>
Craig Bakalian
>
>
>
On Saturday, September 7, 2002, at 01:00 AM, coreaudio-api-
>
email@hidden wrote:
>
>
> Hi Craig,
>
>
>
> You'll need to create a MusicPlayer, set its sequence to the sequence
>
> you've
>
> created, preroll the player, and then call MusicPlayerStart() to start
>
> playback. MusicPlayer provides transport control for the MusicSequence
>
> media (think of it like the MusicPlayer is a CD Player and the
>
> MusicSequence
>
> is a CD.) There's a corresponding MusicPlayerStop() call when you wish
>
> to
>
> stop playback.
>
>
>
> The sequence of calls should look like this:
>
> NewMusicPlayer()
>
> MusicPlayerSetSequence()
>
> MusicPlayerPreroll()
>
> MusicPlayerStart()
>
>
>
> See <AudioToolbox/MusicPlayer.h> for the functions.
>
>
>
> The MusicPlayer should actually set up a default graph for you
>
> (DLSMusicDevice connected to DefaultOutputUnit) if you don't specify a
>
> graph
>
> for the MusicSequence you've given it. it's a convenience.
>
>
>
> Best,
>
> Luke Bellandi
>
> CoreAudio
>
_______________________________________________
>
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
__________________________________________________________________________
"...Been havin' some trouble lately in the sausage business," C.M.O.T.
Dibbler replied.
"What, having trouble making both ends meat?"
__________________________________________________________________________
_______________________________________________
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.