• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
MusicSequenceSetAUGraph(...)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MusicSequenceSetAUGraph(...)


  • Subject: MusicSequenceSetAUGraph(...)
  • From: Luke Bellandi <email@hidden>
  • Date: Mon, 09 Sep 2002 08:53:23 -0700

On 9/7/02 1:34 AM, "Craig Bakalian" <email@hidden> 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?
They are for sending data to the sequence's tracks.

Recording MIDI requires more programmer intervention than MIDI playback
does.
To populate a track with MIDI Events coming in from a MIDI Device (i.e., to
record MIDI), you'd need to create a MIDIReadProc, and add the MIDI
Endpoint(s) you're interested in recording from to an input MIDIPortRef
you've created on a MIDIClientRef you've created. In that read proc, you'd
convert the event timestamps into beat values, and then insert those events
into a MusicTrack.

> 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?

Use

Extern OSStatus MusicSequenceSetMIDIEndpoint (MusicSequence inSequence,
MIDIEndpointRef inEndpoint);

Instead of MusicSequenceSetAUGraph(...);

There is also MusicTrackSetDestMIDIEndpoint(...) which allows a finer level
of routing control.

>> 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.

References: 
 >Re: coreaudio-api digest, Vol 2 #239 - 3 msgs (From: Craig Bakalian <email@hidden>)

  • Prev by Date: Setting the samplerate
  • Next by Date: A driver question - hiding channels in a DMA buffer
  • Previous by thread: Re: coreaudio-api digest, Vol 2 #239 - 3 msgs
  • Next by thread: Re: Sequence and Graph (was coreaudio-api digest, Vol 2 #239 - 3 msgs)
  • Index(es):
    • Date
    • Thread