Logic X and getCurrentPosition

It appears that Logic X is doing weird things with the AudioPlayHead. I do this in the processBlock() function:


For a few calls to processBlock(), usually 1 or 2, the _CurrentPlayHeadInfo structure is filled with garbage or old information. Any idea what is going on here and how to make sure that the structure is filled with up-to-date information?



Read the coding style guidelines re naming your variables with leading underscores.




Thank you so much for this. That must be why it's not working. If only everybody on here was as helpful as you!


Other than that, anybody has a real answer to this? 

Logic is basically broken when it comes to providing stable time data. I have an internal sequencer in my plugin that syncs to the host clock. In order to get it to work reasonably well in Logic, I did two main things: filtered the incoming data by throwing away zeroes and negative and duplicate and otherwise nonsensical inputs, and then used a software PLL to make a stable phasor.

Also look at the isPlaying parameter to processBlock() to help with ignoring garbage from Logic.