• 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
MusicSequence MusicPlayer API questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MusicSequence MusicPlayer API questions


  • Subject: MusicSequence MusicPlayer API questions
  • From: "email@hidden" <email@hidden>
  • Date: Thu, 12 Mar 2009 10:45:57 +0100 (GMT+01:00)

Hi to all,

I would like to know some implementation details of the
MusicPlayer/MusicSequence API:

1. Is the API thread safe? For example:
can one or more threads modify a Music Sequence without taking extra
cautions (lock a mutex) even while the sequence is being played?

2. If
the API is thread safe, is it lock-free? Or better: if one thread tries
to read/modify a Music Sequence concurrently with another thread and
while the sequence is being played, is there any danger that any of the
threads will block on a mutex?

3. Is the MusicSequence implemented
with some kind of linked list? Or better: can I keep pointers to MIDI
events around without being worried about invalidating them with
operations on the MusicSequence?

As a consequence of the above I would
gently ask some design advices.

This is the scenario:
- one GUI
threads communicating asynchronously through a lock-free queue with a
real-time thread
- the real-time thread creates MIDI events (let’s say
randomly) just before they have to be played (with a minimal buffer)
and appends them to a MusicSequence
- a third thread (I imagine spawned
by the API itself) plays the MusicSequence
- both the RT thread and the
GUI thread should be able to keep pointers to the MIDI events in the
sequence

Questions:
1. Is the MusicPlayer/MusicSequence API usable in
this context or do you think I have to roll out my own sequencer?

2.
Would it make sense to schedule the RT thread with a higher priority
than the “playing thread”?

3. In the case of building my own sequencer
I would be inclined to use the same RT thread for creating /*and*/ for
playing out notes with the CoreMIDI low level functions. Do you think
this would be a correct approach?

Thanks in advance for any answer,
insight, whatever... :-)
Bye,
Francesco


 _______________________________________________
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: MusicSequence MusicPlayer API questions
      • From: William Stewart <email@hidden>
  • Prev by Date: iPhone AudioQueueOfflineRender() woes
  • Next by Date: How to fill the ioData parameter in the Audio Unit rendering call back?
  • Previous by thread: Re: iPhone AudioQueueOfflineRender() woes
  • Next by thread: Re: MusicSequence MusicPlayer API questions
  • Index(es):
    • Date
    • Thread