Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 02-09-2019, 07:59 AM   #1
Pollo
Human being with feelings
 
Join Date: Jan 2015
Location: Amsterdam
Posts: 94
Default Reaper reports incorrect position to VST plugins at certain tempo's.

VST plugins can query the host for current time information which the host returns in a VstTimeInfo structure. At certain tempo's Reaper reports incorrect values to the plugin. Noticeably in the values for ppqPos and samplePos, both members of the VstTimeInfo structure.

I observed this for instance at a tempo of 117 BPM. I suspect that it has to do with the fact that at that tempo the number of samples in one beat is not an integer value.

The errors in the time position information make it impossible to sync to the host at these tempo's.

I can provide more information if needed.
Pollo is offline   Reply With Quote
Old 02-11-2019, 04:36 AM   #2
Pollo
Human being with feelings
 
Join Date: Jan 2015
Location: Amsterdam
Posts: 94
Default

More information: it is entirely possible that I just don't fully understand how it should work but I'm observing the following behaviour that I can't explain. I am debugging a VST plugin using the following code:

void processReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
VstTimeInfo* pInfo = getTimeInfo(0);
if (pInfo) {
if (pInfo && (pInfo->flags & kVstTransportChanged) && (pInfo->flags & kVstTransportPlaying)) {
// set breakpoint here
// it will hit only the first time that playback starts
}
}


I have a project set up. Plugin is inserted on a track, nothing else. BPM = 117. I have a ruler offset of 4 bars, so the first bar is -3, then -2, etc. Bar 1 is actually the fourth bar of the project. I set the playback cursor at bar 1 and start playback and then look at the values I receive from getTimeInfo(). This is what I get:

samplePos = 5.4999999999736815
ppqPos = 15.999993197278911

I would expect to see this:

samplePos = 0.0000000000000
ppqPos = 16.0000000000000
Pollo is offline   Reply With Quote
Old 02-11-2019, 06:46 AM   #3
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

I think you will just have to accept the ppqPos is slightly off and quantize it yourself to the closest beat division. Is the behavior different in other hosts?
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 02-11-2019, 06:55 AM   #4
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,821
Default

https://forum.cockos.com/showthread.php?t=216973
schwa is offline   Reply With Quote
Old 02-11-2019, 08:17 AM   #5
EvilDragon
Human being with feelings
 
EvilDragon's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 24,798
Default

Wow, same thread, same person, same question.
EvilDragon is offline   Reply With Quote
Old 02-13-2019, 05:16 AM   #6
Pollo
Human being with feelings
 
Join Date: Jan 2015
Location: Amsterdam
Posts: 94
Default

Quote:
Originally Posted by EvilDragon View Post
Wow, same thread, same person, same question.
same person, yes. same thread, no (how could it be?). same question, sort of.
Pollo is offline   Reply With Quote
Old 02-13-2019, 05:18 AM   #7
Pollo
Human being with feelings
 
Join Date: Jan 2015
Location: Amsterdam
Posts: 94
Default

The problem is solved. This can be closed.

schwa, thanks for the clarification.
Pollo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:44 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.