• 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
Midi and Audio timebases in an AUGraph
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Midi and Audio timebases in an AUGraph


  • Subject: Midi and Audio timebases in an AUGraph
  • From: Aran Mulholland <email@hidden>
  • Date: Wed, 20 Feb 2013 13:20:22 +1100

I am working with the AUSampler and the MusicSequence, MusicPlayer and MusicTrack. I would like to schedule midi events in a pre render callback (AudioUnitAddRenderNotify) Is there a way to determine what midi time span a render callback will cover? In the render notify I can find out the current position of the MusicPlayer as follows:

MusicTimeStamp musicTimeStamp = 0;    

MusicPlayerGetTime(musicPlayer_, &musicTimeStamp);


I also have the audioTimeStamp so I can determine the mSampleTime and mHostTime as well as the number of samples in the buffer. What I don't know is what MusicTimeStamp range the render callback will cover. This will be further compounded by the fact that the tempo can change. When a MusicSequence is associated with an AUGraph what is the relationship between the two time bases (audio and midi)?


Supplemental question:


Thinking it through can the tempo even change during the render callback? How would the following situation be dealt with:


Render callback fires and requests 1024 frames

AUSampler (which is driven by a midi track returns the frames)

Tempo change happens (goes extremely fast)

Midi note that now should have been scheduled to play in the 1024 frames gets played when?

 _______________________________________________
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: Midi and Audio timebases in an AUGraph
      • From: Aran Mulholland <email@hidden>
  • Prev by Date: third party interfaces on iOS
  • Next by Date: Playback Filtering
  • Previous by thread: third party interfaces on iOS
  • Next by thread: Re: Midi and Audio timebases in an AUGraph
  • Index(es):
    • Date
    • Thread