• 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
Re: MusicPlayer + MusicSequenceSetUserCallback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MusicPlayer + MusicSequenceSetUserCallback


  • Subject: Re: MusicPlayer + MusicSequenceSetUserCallback
  • From: David Hicks <email@hidden>
  • Date: Wed, 13 Jul 2011 10:32:58 -0400

Skinny Tod,
Glad to be of help.

>From reading the CoreAudio docs it seems like it would be possible to
>specify multiple endpoints - for my needs: a DLSMusicDevice (to play the
>sound) and (maybe) a virtual port - to get the actual event data in order
>to display it. I may have this wrong though- tinkering with it now.

I've never tried to work with MIDI Endpoints, so I'm interested to hear how that works out. If it isn't entirely satisfactory, consider:

If you need the DLS Synth, my first thought is to use an AUGraph. PlaySequence should provide guidance in setting up the default AUGraph with DLS synth. The nice thing is that the connections between the MusicSequence and the AUGraph are done for you. (Unless you want to play to a Plugin synth, then you would need to make your own nodes and connections.)

Since my app is all about algorithmic manipulation of MIDI note data, I always have the MIDI events at hand, in my TrackObject and NoteObject classes, and therefore just inspect the NoteObjects' timestamps for when to display their data.

So I'm just speculating, but I think it might work to use the MusicEventIterator (each of which gets associated with a track, as from a MusicSequence).
The MusicTrack API doesn't seem to allow you to get the individual events, nor does the MusicSequence. That seems to leave the MusicEventIterator. I've seen some postings about them on this list, so do a search and see. The most useful method would probably be this one:

MusicEventIteratorGetEventInfo

Gets information about the event at a music event iterator’s current position.

OSStatus MusicEventIteratorGetEventInfo (
   MusicEventIterator  inIterator,
   MusicTimeStamp      *outTimeStamp,
   MusicEventType      *outEventType,
   const void          **outEventData,
   UInt32              *outEventDataSize
);
Then, in the main thread NSTimer callback you could display data for whichever event is up next. That's not a small project, but from my limited experience looks like a way you may get what you want.

Keep us posted...

David
 _______________________________________________
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

  • Follow-Ups:
    • Re: MusicPlayer + MusicSequenceSetUserCallback
      • From: Skinny Tod <email@hidden>
  • Prev by Date: audio unit deinstantiation thread
  • Next by Date: Re: audio unit deinstantiation thread
  • Previous by thread: Re: MusicPlayer + MusicSequenceSetUserCallback
  • Next by thread: Re: MusicPlayer + MusicSequenceSetUserCallback
  • Index(es):
    • Date
    • Thread