• 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: Grabbing MusicPlayer events during playback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Grabbing MusicPlayer events during playback


  • Subject: RE: Grabbing MusicPlayer events during playback
  • From: David Hicks <email@hidden>
  • Date: Tue, 28 Feb 2012 09:47:10 -0500

James,

I haven’t done this, but it looks like it would work. If you’re willing to fiddle with the events in your tracks, you could do this by adding UserEvents to a MusicSequence’s MusicTracks (at the same timestamps as your NoteOn events). If you analyze the track before playback and know the durations, you could add the duration info to these UserEvents. Then, with a SequenceCallback registered, you will get alerted at every UserEvent with your duration Info. See MusicSequence & MusicTrack references.

David

 

MusicSequenceSetUserCallback

Registers a user callback function with a music sequence.

OSStatus MusicSequenceSetUserCallback (
    MusicSequence              inSequence,
    MusicSequenceUserCallback  inCallback,
    void                       *inClientData
);
Parameters

inSequence

The music sequence that you want to add a user callback function to.

inCallback

A reference to your callback function. Use NULL to remove a registered callback function.

inClientData

Your data that the music sequence provides back to your callback function when it is invoked.

Return Value

A result code.

Discussion

The music sequence invokes your callback for each user event added to any music track owned by the sequence. If there is a callback registered, then UserEvents will be chased when MusicPlayerSetTime is called. In that case the inStartSliceBeat and inEndSliceBeat will both be the same value and will be the beat that the player is chasing to.

MusicTrackNewUserEvent

Adds an event of type MusicEventUserData to a music track.

OSStatus MusicTrackNewUserEvent (
    MusicTrack                inTrack,
    MusicTimeStamp            inTimeStamp,
    const MusicEventUserData  *inUserData
);

 

 


From: coreaudio-api-bounces+d.hicks=email@hidden [mailto:coreaudio-api-bounces+d.hicks=email@hidden] On Behalf Of James Maxwell
Sent: Monday, February 27, 2012 10:01 PM
To: email@hidden
Subject: Grabbing MusicPlayer events during playback

 

Hello All,

 

I'm wondering if there's a good way to grab MusicPlayer events within an application, during playback, **without** using a MIDI endpoint? I have a system that has to "listen" to its own playback, but I don't want to use the actual MIDI endpoint, in order to avoid feedback loops. Also, it would be great to be able to get the duration info, which I wouldn't normally have in "live" playback (i.e., I don't know when a note will end), but would have directly from the sequence/track. Any way to do this?

 

thanks,

 

J.

 

------------------------------------------------------

James B. Maxwell

Composer/Researcher/PhD Candidate

 

 

 



 

 _______________________________________________
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: Grabbing MusicPlayer events during playback
      • From: James Maxwell <email@hidden>
References: 
 >Grabbing MusicPlayer events during playback (From: James Maxwell <email@hidden>)

  • Prev by Date: Grabbing MusicPlayer events during playback
  • Next by Date: Re: Grabbing MusicPlayer events during playback
  • Previous by thread: Grabbing MusicPlayer events during playback
  • Next by thread: Re: Grabbing MusicPlayer events during playback
  • Index(es):
    • Date
    • Thread