• 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
HostCallback_GetBeatAndTempo problem in Logic
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HostCallback_GetBeatAndTempo problem in Logic


  • Subject: HostCallback_GetBeatAndTempo problem in Logic
  • From: Adrian Pflugshaupt <email@hidden>
  • Date: Wed, 11 Nov 2009 11:36:04 +0100

I'm writing a plugin which needs to calculate the beat position accurate to the sample. In order to do this I used HostCallback_GetBeatAndTempo. After getting weird results in Logic (8 & 9) I wrote a test that just outputs the beat position delta and the number of samples per packet:

if ( mHostCallbackInfo.beatAndTempoProc != NULL ) {
mHostCallbackInfo.beatAndTempoProc ( mHostCallbackInfo.hostUserData,
&outCurrentBeat,
&outCurrentTempo );
printf("Beat delta %f samples %u\n", outCurrentBeat - currentBeat, sampleFrames);
currentBeat = outCurrentBeat;
}


From this I'm getting this result (similar for any buffer size):

Beat delta 0.018034 samples 512
Beat delta 0.016016 samples 512
Beat delta 0.018034 samples 512
Beat delta 0.016016 samples 512
Beat delta 0.018034 samples 512
Beat delta 0.017057 samples 512
Beat delta 0.016992 samples 512
Beat delta 0.017057 samples 512
Beat delta 0.016992 samples 512
Beat delta 0.017057 samples 512
etc.

This comes as a big surprise as I'd expect the delta to be much more constant! For a 44.1 kHz sample rate it really should be 0.016098 and there large (more than 1 sample! ) fluctuations break my plugin. Does anyone know why this is happening? Am I doing something wrong expecting the currentBeat result of the hostcallback to be sample- accurate?

thanks in advance

Adrian Pflugshaupt (apulSoft.ch)


_______________________________________________ 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
  • Prev by Date: Could not hear audio queue sound to bluetooth headset
  • Next by Date: Re: AudioQueue performance on iPhone
  • Previous by thread: Could not hear audio queue sound to bluetooth headset
  • Next by thread: Callback for Volume change or Mute/Unmute
  • Index(es):
    • Date
    • Thread