View Single Post
Old 02-07-2019, 05:54 PM   #1
Pollo
Human being with feelings
 
Join Date: Jan 2015
Location: Amsterdam
Posts: 94
Default VstTimeInfo problem

I am working on a plugin that relies on VstTimeInfo, specifically the value of ppqPos. This seemed to work well, until I started a project that had the (admittedly) uncommon tempo of 117 BPM. Now Reaper returns values for ppqPos that seem to be plain wrong.

To give an example: I have a project in 4/4, tempo is 120 BPM. I set the cursor at the beginning of bar 5. When I start playback, the first ppqPos value I receive is 32.00000000. This is right

Now I change the tempo to 117. Again I start playback at bar 5. Now the first ppqPos value I get is 31.999986394557823. That is wrong.

Is this a known bug?
How to deal with this? I can maybe use the samplePos value instead and calculate the exact beat position myself. But then maybe I run out of sync with the Reaper metronome?
You would think that it's not that hard to calculate this correctly. Why is it unreliable?

I'd appreciate any suggestions.
Pollo is offline   Reply With Quote