COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 01-10-2019, 11:36 PM   #1
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 248
Default GetSamplePos() - not returning what I expected

The name of this function "GetSamplePos()" implies that it reports a POSITION - I assumed of the current sample from start of file in the DAW timeline - but that's not what I'm seeing.

I have GetSamplePos() placed in ProcessDoubleReplacing() before the loop. I expected it to report the first sample# of each block - going up as the song plays but down when the cursor is moved back to the left.

What I'm getting, instead, is a constantly increasing number regardless of playhead location. In other words, it's COUNTING total samples processed since the plugin was initialized, not reporting the play POSITION.

Is this how this function is supposed to work or is something wrong?


BTW - GetSamplePos() is declared in IPlugBase.h but there is no associated function defined for it in IPlugBase.cpp It does not appear to inherit from any other class. Does that mean this function isn't implemented, broken or is something missing in my files?

Last edited by Nonlinear; 01-11-2019 at 01:42 AM.
Nonlinear is online now   Reply With Quote
Old 01-11-2019, 06:32 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,913
Default

Quote:
Originally Posted by Nonlinear View Post
BTW - GetSamplePos() is declared in IPlugBase.h but there is no associated function defined for it in IPlugBase.cpp It does not appear to inherit from any other class. Does that mean this function isn't implemented, broken or is something missing in my files?
Each plugin format (VST2, VST3, AU etc) implements it separately because there's a different way each format gets it from the host application.

I suspect you are seeing a buggy (or "unexpected") behavior from Wavelab where it's simply accumulating time into the sample position instead of updating it based on its own play position. For example in Reaper the position corresponds to Reaper's play cursor position : it changes accordingly when the playback is seeked or when transport loop playback jumps to the beginning of the loop.

Did you test getting the sample position in any other host than Wavelab?

edit : The IPlug test plugin I did, running in Reaper :

__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/

Last edited by Xenakios; 01-11-2019 at 08:57 AM.
Xenakios is offline   Reply With Quote
Old 01-11-2019, 10:30 AM   #3
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 248
Default

Quote:
Originally Posted by Xenakios View Post
Each plugin format (VST2, VST3, AU etc) implements it separately because there's a different way each format gets it from the host application.
Are you saying the function is blank until you write your own code for it? Typically functions in IPlug are defined "If AU do this, If VST do that, etc." Can you further explain what you mean here?

Thank you for the example from Reaper - I see it does work as expected there.

This is quite frustrating. How are so many developers writing plugins that seem to work EVERYWHERE with the same code? They typically offer PC and Mac versions of VST, VST3, AU and AAX. They do not break that down further into "Version for Wavelab", "Version for Reaper", etc. How is this possible given all that we've discussed here about DAW variations?

It seems that plugin "standards" are not very - standard!
Nonlinear is online now   Reply With Quote
Old 01-11-2019, 10:38 AM   #4
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,913
Default

Quote:
Originally Posted by Nonlinear View Post
Are you saying the function is blank until you write your own code for it? Typically functions in IPlug are defined "If AU do this, If VST do that, etc." Can you further explain what you mean here?
I mean that the GetSamplePosition is implemented in the IPlugVST.h/cpp, IPlugVST3.h/cpp, IPlugAAX.h/cpp etc files in IPlug. There is no way to implement it in IPlugBase.h/cpp, therefore the implementation is blank or rather pure virtual in that. (But when you call the function in your own plugin's code, the correct version for the plugin format currently in use will be called.)
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is offline   Reply With Quote
Old 01-11-2019, 11:33 AM   #5
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 248
Default

Quote:
Originally Posted by Xenakios View Post
I mean that the GetSamplePosition is implemented in the IPlugVST.h/cpp, IPlugVST3.h/cpp, IPlugAAX.h/cpp etc files in IPlug. There is no way to implement it in IPlugBase.h/cpp, therefore the implementation is blank or rather pure virtual in that. (But when you call the function in your own plugin's code, the correct version for the plugin format currently in use will be called.)
Ohhhhh, yes, I see. Thank you for the clarification.

Since you have been following my posts here about "Resetting on stop/start" I thought I'd share something - I have tried some plugins from other developers here on the WDL forum and their plugins DO NOT reset in Wavelab on stop/start either. They resume from where they left off just like mine does. That seems like a problem that could get lots of complaints from users, especially with something like a long reverb or delay that steps all over the new audio being played until it clears out.

I guess the plugins I tested that DO reset in Wavelab on stop/start were developed by some other means (Juce perhaps?) or maybe directly coded from the SDKs using cmake, etc. I'm afraid such detailed, hard coding is beyond my current skill level.
Nonlinear is online now   Reply With Quote
Old 01-11-2019, 11:55 AM   #6
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,913
Default

Quote:
Originally Posted by Nonlinear View Post
That seems like a problem that could get lots of complaints from users, especially with something like a long reverb or delay that steps all over the new audio being played until it clears out.

I guess the plugins I tested that DO reset in Wavelab on stop/start were developed by some other means (Juce perhaps?) (
Using JUCE is not the explanation. I tested the ValhallaRoom reverb plugin (which is coded with JUCE) in Ableton Live which does not send Reset()/prepareToPlay calls when starting/stopping/seeking. The result is that long reverb tails keep on playing. Ableton Live does update the play position info correctly, though. So technically it could be argued that the ValhallaRoom plugin has a bug in it because it doesn't clear its reverb tail when there's a discontinuity in the playback in the host. (It does clear the tail when used in Reaper, though.)
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/

Last edited by Xenakios; 01-11-2019 at 12:06 PM.
Xenakios is offline   Reply With Quote
Old 01-11-2019, 12:03 PM   #7
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 248
Default

Quote:
Originally Posted by Xenakios View Post
Using JUCE is not the explanation. I tested the ValhallaRoom reverb plugin (which is coded with JUCE) in Ableton Live which does not send Reset()/prepareToPlay calls when starting/stopping/seeking. The result is that long reverb tails keep on playing. Ableton Live does update the play position info correctly, though. So technically it could be argued that the ValhallaRoom plugin has a bug in it because it doesn't clear its reverb tail when there's a discontinuity in the playback in the host.
I guess it's time to tie a bow on this. Looks like I've gone as far as I can.

Thank you for your help!
Nonlinear is online now   Reply With Quote
Old 01-11-2019, 12:16 PM   #8
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,913
Default

Quote:
Originally Posted by Nonlinear View Post
I guess it's time to tie a bow on this. Looks like I've gone as far as I can.
The only other suggestion I can give is that you could contact Steinberg and ask if Wavelab does some special (probably non-standard) call into the plugins when starting/stopping the playback in Wavelab. (It can be pretty frustrating to communicate with them, though...)
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios 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 08:36 PM.


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