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 12-29-2018, 09:31 AM   #1
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default Initializing plugins for "off line" vs. "real time" usage?

Many DAWs, when used in real time mode, send a constant stream of audio data to active plugins. It's like real electronic gear that is turned on, warmed up and idling before any audio is processed.

Other DAWs (and most "off line" processes) do not send any audio data to the plugins until Play or Render is initiated by the user.

So, how do we initialize plugins - like dynamic processors, filters, delay lines, etc. - when there is no "warm up/settle down" time before audio data arrives? It's like trying to use electronic equipment the instant you turn it on.

How is this done?

Last edited by Nonlinear; 12-29-2018 at 09:44 AM.
Nonlinear is offline   Reply With Quote
Old 12-29-2018, 09:46 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Ideally your plugin should not need to know anything about the offline/realtime state of the host. (There are exceptions to that but a simple effect or synthesis based instrument shouldn't usually care about that.)

Like JUCE's AudioProcessor has the prepareToPlay method, IPlugBase has the Reset method you should override to be called from the host before the audio processing calls start happening. You should clear your buffers, reset your envelope followers etc there.
__________________
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; 12-29-2018 at 10:02 AM.
Xenakios is online now   Reply With Quote
Old 12-29-2018, 10:02 AM   #3
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
Ideally your plugin should not need to know anything about the offline/realtime state of the host. (There are exceptions to that but a simple effect or synthesis based instrument shouldn't usually care about that.)

Like JUCE's AudioProcessor has the prepareToPlay method, IPlugBase has the Reset method you should override to be called from the host before the audio processing calls start happening.
Thank you for the reply. What I'm trying to understand is how you determine a starting point for something like a delay line or FIR filter. You can't simply initialize the whole array to zeros and expect it to work the instant it receives sound. It needs some "lead in/settling time".

How do you address that type of thing using static initialization values?
Nonlinear is offline   Reply With Quote
Old 12-29-2018, 10:07 AM   #4
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Quote:
Originally Posted by Nonlinear View Post
Thank you for the reply. What I'm trying to understand is how you determine a starting point for something like a delay line or FIR filter. You can't simply initialize the whole array to zeros and expect it to work the instant it receives sound. It needs some "lead in/settling time".

How do you address that type of thing using static initialization values?
Sorry, I don't really understand what you are asking. It's obviously up to you to know how the algorithms you are using work, so there's no generic answer for "what should the initial values be". (Which you would set up in the IPlugBase's Reset method.)

Plugins have no concept of "lead in/settle in time". You just get audio buffers of some size from the host and you process buffers of exactly that size in the plugin. It doesn't matter if the processing is realtime or offline.
__________________
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 online now   Reply With Quote
Old 12-29-2018, 10:26 AM   #5
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
Sorry, I don't really understand what you are asking. It's obviously up to you to know how the algorithms you are using work, so there's no generic answer for "what should the initial values be". (Which you would set up in the IPlugBase's Reset method.)
Right, yes, I did not expect a generic answer - it's the approach I'm asking about.

When you turn on real electronic equipment - especially tube gear - it takes time for it to warm up/settle down before it can process audio.

Same thing can happen in plugins. Filters, envelope followers, etc., that have to "settle" before they can start processing audio.

For example, something like a noise gate or compressor - do you initialize to full attenuation - or zero attenuation? Without any signal history it has no idea where to start on that first sample. Same situation with FIR filters, delay lines, etc.

So, what is the approach to initializing plugins like this so they start INSTANTLY and don't produce garbage when processing the first few samples?
Nonlinear is offline   Reply With Quote
Old 12-29-2018, 10:33 AM   #6
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Quote:
Originally Posted by Nonlinear View Post

So, what is the approach to initializing plugins like this so they start INSTANTLY and don't produce garbage when processing the first few samples?
Initialize your algorithm as needed in the plugin's Reset method.

Your plugin is flawed if it depends for example on being fed silent buffers first before the actual audio. There's nothing in the plugin formats that would require hosts to do that. Your algorithms might need that but you will need to implement that internally in the plugin.
__________________
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 online now   Reply With Quote
Old 12-29-2018, 11:02 AM   #7
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
Initialize your algorithm as needed in the plugin's Reset method.

Your plugin is flawed if it depends for example on being fed silent buffers first before the actual audio. There's nothing in the plugin formats that would require hosts to do that. Your algorithms might need that but you will need to implement that internally in the plugin.
Is "Reset()" a function called by the host or is it an internal IPlug thing?

I seem to recall from VST2 that there were "Idle()" and "PreparetoPlay()" functions that WERE called from the host - but not always.

I have been initializing my variables, arrays, etc., in the plugin constructor and updating in the Process() block before the process loop. Is that wrong?
Nonlinear is offline   Reply With Quote
Old 12-29-2018, 11:07 AM   #8
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Quote:
Originally Posted by Nonlinear View Post

I have been initializing my variables, arrays, etc., in the plugin constructor and updating in the Process() block before the process loop. Is that wrong?
Yeah, just initializing in the constructor is not really enough. You have more up to date information available in the Reset call like the maximum buffer size the host is going to use and the sample rate, so that's really the proper place to do the DSP initializations.

How you deal with your variables in your Process method is up to you and what you need to do. Obviously many algorithms will need their variables to remain at their last values between the Process calls, so you should not be resetting them at every Process call. (And in that case they should be member variables of the plugin class. NEVER use global or static variables that you are going to modify in a plugin.)
__________________
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; 12-29-2018 at 11:12 AM.
Xenakios is online now   Reply With Quote
Old 12-29-2018, 11:49 AM   #9
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
Yeah, just initializing in the constructor is not really enough. You have more up to date information available in the Reset call like the maximum buffer size the host is going to use and the sample rate, so that's really the proper place to do the DSP initializations.

How you deal with your variables in your Process method is up to you and what you need to do. Obviously many algorithms will need their variables to remain at their last values between the Process calls, so you should not be resetting them at every Process call. (And in that case they should be member variables of the plugin class. NEVER use global or static variables that you are going to modify in a plugin.)
OK, so is "Reset()" called by the host? If so, when? I had read elsewhere that Reset() doesn't always work -that's why I started updating everything in Process().
Nonlinear is offline   Reply With Quote
Old 12-29-2018, 11:56 AM   #10
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Quote:
Originally Posted by Nonlinear View Post
OK, so is "Reset()" called by the host? If so, when? I had read elsewhere that Reset() doesn't always work -that's why I started updating everything in Process().
If Reset isn't called at any point by the host(*), the host is plain buggy and you should stop using it. (However, it is possible the host only ever calls it just once and that would be allowed behavior.) It is called before the Process calls start happening. It may be called multiple times too before the Process calls start. Your code should guard against that if you are doing some expensive initialization, for example.

You may be able to do some resetting in the Process call too, but you will need to keep additional tracking member variables to guess if the audio processing should be resetted. It probably isn't worth the trouble since the Reset call is meant to be overridden by the plugin for that purpose.

It's really difficult to understand what is the problem you are having exactly. Can you provide some concrete example of a situation that isn't clear for you?

(*) Technically, the host calls some function or opcode of the plugin format in question and the IPlug wrapper code then calls IPlugBase::Reset.
__________________
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; 12-29-2018 at 12:02 PM.
Xenakios is online now   Reply With Quote
Old 12-29-2018, 12:24 PM   #11
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
It's really difficult to understand what is the problem you are having exactly. Can you provide some concrete example of a situation that isn't clear for you?
I am just trying to make sure I have all the bases covered. I had a plug that was not working right in Wavelab (another thread on this forum) and some worries as a result. It's unsettling when a plugin works perfectly in one host but not another (i.e., is it my plug or the DAW's fault?). Just trying to make it as "bulletproof" as possible.

Thank you for the info and tips. Will add "Reset()" to my code.
Nonlinear is offline   Reply With Quote
Old 12-29-2018, 12:28 PM   #12
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Quote:
Originally Posted by Nonlinear View Post
I am just trying to make sure I have all the bases covered. I had a plug that was not working right in Wavelab (another thread on this forum) and some worries as a result. It's unsettling when a plugin works perfectly in one host but not another (i.e., is it my plug or the DAW's fault?).
There are no easy solutions, something will always break in some situation in some host. You will just need to be aware of that happening and try to fix things as they appear. It's not realistic to plan to release just one version of a plugin that will work for everybody. (And keep on working, operating system and host updates may always break things again in the future.) For example the VST2 plugin format was never planned by Steinberg to work like that for developers. The specification is pretty vague and things have "just kind of mostly worked". VST3 isn't necessarily much better in that regard, the plugin frameworks like JUCE and IPlug and the hosts will always end up doing things in incompatible ways.
__________________
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; 12-29-2018 at 12:34 PM.
Xenakios is online now   Reply With Quote
Old 12-30-2018, 10:18 AM   #13
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
There are no easy solutions, something will always break in some situation in some host. You will just need to be aware of that happening and try to fix things as they appear. It's not realistic to plan to release just one version of a plugin that will work for everybody.
Yes, and that has me baffled. This isn't subjective art - it objective science - "ones and zeros". If everyone is building hosts and plugins using the same VST SDK how come a VST plugin that works in DAW A doesn't work in DAW B?
Nonlinear is offline   Reply With Quote
Old 12-30-2018, 10:31 AM   #14
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Quote:
Originally Posted by Nonlinear View Post
If everyone is building hosts and plugins using the same VST SDK how come a VST plugin that works in DAW A doesn't work in DAW B?
Because many of the plugin "standards" don't explicitly determine how the plugins and hosts should work. The SDKs are just header and source files, not detailed explanations for the exact behaviors the plugins and hosts should have. Plugins and hosts will always end up having bugs or behavior inconsistencies because nobody forces them to work in a certain way. (As a counter example, the Propellerhead Rack Extensions have rigorous demands for the plugin developers and Propellerhead will themselves ensure the plugins work as intended.)

And yeah, there are example projects in the SDKs but they do not necessarily cover every use case or even follow good coding practices. The SDK documentations also don't necessarily explain all the fine details involved. Also with things like JUCE and IPlug there is the additional problem that they have to work for multiple plugin formats, which makes things even more complicated.
__________________
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 online now   Reply With Quote
Old 01-06-2019, 11:10 PM   #15
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
Your plugin is flawed if it depends for example on being fed silent buffers first before the actual audio. There's nothing in the plugin formats that would require hosts to do that. Your algorithms might need that but you will need to implement that internally in the plugin.
Many audio DSP processes require some amount of data history. Even a simple, second order IIR filter, for example, saves 2 old samples (n-1 and n-2) to be used in the calculation of the current output sample. If we simply initialize those two "old sample" variables to zero, the first few output samples from the plugin will not be correct since it is using zeros where there should be actual audio data.

So, to be 100% correct in this simple IIR example it seems we would want to report 2 samples of latency to the host and then add a 2 sample delay to the plugin. In that way the plugin will have time to completely fill with audio data before it produces its first output sample. More complex plugins that use FIR filters, FFTs, etc., may require multiple delays (reported as one overall latency value) where arrays and other variables need to be completely filled with audio data before any audio output is generated.

That seems to be the CORRECT way to design plugins yet I have never seen plugins that report only 2 samples of delay compensation to the host. I'm assuming that many designers ignore small errors and simply "zero out" the variables on initialization. In extreme cases this could cause the plugin to pop when first started (and I HAVE seen plugins do this!).

So, it seems it would be best practice to compensate every process that needs "old" values - and not just processes that require "look ahead" - to make sure every audio sample required in a plugin process is filled with real data before any output takes place. Yes?

Last edited by Nonlinear; 01-07-2019 at 12:35 AM.
Nonlinear is offline   Reply With Quote
Old 01-07-2019, 12:28 AM   #16
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,984
Default

Quote:
Originally Posted by Nonlinear View Post
That seems to be the CORRECT way to design plugins yet I have never seen plugins that report only 2 samples of delay compensation to the host. I'm assuming that many designers ignore small errors and simply "zero out" the variables on initialization.
Exactly. Do note though that this is not as "bad" as it seems, because lots of external (semi) hardware also introduce latency, non of which is reported obviously.
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 01-07-2019, 09:21 AM   #17
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Tale View Post
Exactly. Do note though that this is not as "bad" as it seems, because lots of external (semi) hardware also introduce latency, non of which is reported obviously.
Filling a plugin's data buffers using the "look ahead and delay" method I suggested here solves the problem of producing valid data on the very first output sample - but creates more latency when used "live".

So the point of my thread here is that there CAN BE differences in how plugins are initialized for offline vs. live uses. How is this handled? Is there code in WDL-OL that detects whether a plugin is being used "off line" vs. "live"? I think VST has something for that (or used to).

Last edited by Nonlinear; 01-07-2019 at 09:28 AM.
Nonlinear is offline   Reply With Quote
Old 01-07-2019, 09:38 AM   #18
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Quote:
Originally Posted by Nonlinear View Post
Is there code in WDL-OL that detects whether a plugin is being used "off line" vs. "live"?
Like I mentioned previously, your plugin shouldn't really care about that at all. (There are a few exceptions to that but I haven't seen anything in your posts that would indicate you are dealing with one of those situations.)
__________________
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 online now   Reply With Quote
Old 01-07-2019, 09:44 AM   #19
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
Like I mentioned previously, your plugin shouldn't really care about that at all.
I have tried to explain here why it CAN matter. A FIR filter, for example, will not produce valid output on its first sample if its array is initialized to all zeroes. So, it seems a plugin DOES need to care about it!

If I'm not getting it please try again - I really want to know how this is handled!
Nonlinear is offline   Reply With Quote
Old 01-07-2019, 09:57 AM   #20
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

There isn't any significant difference between "live" and "offline" usage. In both cases the host gives you audio buffers to process. The plugin should not assume anything about the contents of those buffers or how often the buffers are given to be processed.

Some hosts may be running the plugins all the time when used "live", possibly giving the plugins silent audio buffers if a live hardware input isn't connected or the playback transport is not running, but not all hosts will do that. (They may just stop calling the plugin's audio processing.) In any case, the plugin should not really care about that at all.

If your algorithm can't tolerate zeros as its initial input, it is either flawed or you will have to figure out some other way to initialize it. And it's impossible for an outsider to say what that other way should be, since it's an algorithm written or chosen by you.
__________________
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-07-2019 at 10:03 AM.
Xenakios is online now   Reply With Quote
Old 01-07-2019, 10:10 AM   #21
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
There isn't any significant difference between "live" and "offline" usage. In both cases the host gives you audio buffers to process. The plugin should not assume anything about the contents of those buffers or how often the buffers are given to be processed.

Some hosts may be running the plugins all the time when used "live", possibly giving the plugins silent audio buffers if a live hardware input isn't connected or the playback transport is not running, but not all hosts will do that. (They may just stop calling the plugin's audio processing.) In any case, the plugin should not really care about that at all.

If your algorithm can't tolerate zeros as its initial input, it is either flawed or you will have to figure out some other way to initialize it. And it's impossible for an outsider to say what that other way should be, since it's an algorithm written or chosen by you.
An audio file could, in reality, have non-zero audio data present on it's very first sample. How would a plugin that uses a FIR filter produce a valid output on that very first sample if its array is initialized to all zeroes?

"Off line" processing has no "settling time" before the audio arrives - "on line" processing usually does. I don't see how they could possibly be initialized the same way.

Last edited by Nonlinear; 01-07-2019 at 10:20 AM.
Nonlinear is offline   Reply With Quote
Old 01-07-2019, 10:22 AM   #22
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Quote:
Originally Posted by Nonlinear View Post
An audio file could, in reality, have audio data present on it's very first sample. How would a plugin that uses a FIR filter produce a valid output on that very first sample if its array is initialized to all zeroes?
The plugin can output silence (zeros) until there is valid output available. (Again, it's up to you to know how your algorithms behave and what is considered "valid output".) However because that isn't useful output and delays the audio, the plugins can report that as their latency and the host may do something useful with that information. (For example with offline renders it could leave out those initial silent samples from the output file.)
__________________
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-07-2019 at 11:24 AM.
Xenakios is online now   Reply With Quote
Old 01-07-2019, 12:25 PM   #23
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
The plugin can output silence (zeros) until there is valid output available.
OK, I can live with zeroes as the FIR filter loads with new data at the beginning of a file but I cannot have OLD data mixed with new data in that array when jumping to a new/mid file playback location. How do you clear buffers in this case - i.e., mid file stop/start/rewind, etc.?

Is there any method - or approach - for calling "Reset()" on playback start/stop? It seems there should be some kind of "Resume()" function but I don't see any such thing.
Nonlinear is offline   Reply With Quote
Old 01-07-2019, 12:39 PM   #24
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Quote:
Originally Posted by Nonlinear View Post
Is there any method - or approach - for calling "Reset()" on playback start/stop?
The host should cause that to be called for IPlug based plugins when needed. (For example when seeking in the host timeline.) If the host doesn't do that, it's unfortunate and could be considered a bug in the host.

If it's absolutely essential for you to know when the audio processing needs to be resetted and you can't trust the host makes the Reset() calls, you could keep track of the timecode of the host and try to guess if a seek/pause/whatever relevant thing happened. If the host doesn't provide the timecode info and doesn't make the Reset() calls, you are out of luck.

Anyway, it seems to me you are massively over-complicating all this in your mind.
__________________
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 online now   Reply With Quote
Old 01-07-2019, 01:44 PM   #25
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
Anyway, it seems to me you are massively over-complicating all this in your mind.
It's not in my mind - it's in my plugin!

I am using a FIR filter in a dynamics processor. The filter has significant amounts of Past and Future values stored in its array and it is having issues when "seeking" (jumping around in the DAW) and when processing "off line".

I am testing in Wavelab Pro 9 and it does not appear to call Reset() on stop/start only when the audio file is first loaded. I clear the buffer in Reset() but it doesn't have any affect when playback is stopped and resumed. If I play the track from the beginning the plugin works as intended. But if I stop playback mid-track and then play from the beginning I get a different result. That tells me the buffer is not clearing.

My thought on how to fix this was to load the ENTIRE array using "lookahead" and then delaying the audio as required to match. That fixes the "seeking" problem and the "there is no history yet" problem of offline processing - but causes a new problem of more latency in live playback and an "end of file" problem in rendering.

If I'm thinking about this too much where should I stop? Design for "live" use or design for "rendering" use and let the rest fall where it may? Seems kinda incomplete!
Nonlinear is offline   Reply With Quote
Old 01-07-2019, 01:52 PM   #26
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Seems like Wavelab is simply buggy or at least behaving badly. It's up to you to decide how much work you want to put into your plugin to deal with just that. I guess it's worth it if a significant amount of paying users of your plugin are using that host?
__________________
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 online now   Reply With Quote
Old 01-07-2019, 02:37 PM   #27
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

By the way, it looks like Reset() probably isn't commonly called by all hosts when stopping and restarting or seeking the playback, after all. At least Reaper does do that but for example Ableton Live does not. Sorry for the confusion. This would warrant further testing with more hosts to better understand the behaviors.
__________________
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 online now   Reply With Quote
Old 01-07-2019, 04:48 PM   #28
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 249
Default

Quote:
Originally Posted by Xenakios View Post
By the way, it looks like Reset() probably isn't commonly called by all hosts when stopping and restarting or seeking the playback, after all. At least Reaper does do that but for example Ableton Live does not. Sorry for the confusion. This would warrant further testing with more hosts to better understand the behaviors.
Thank you for that update and now it begs the question: how do you clear filters, buffers, etc., in that case to prevent pops/erratic operation when the user is jumping around in the track - if Reset() is not always called on stop/restart?
Nonlinear is offline   Reply With Quote
Old 01-07-2019, 05:01 PM   #29
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,962
Default

Quote:
Originally Posted by Nonlinear View Post
Thank you for that update and now it begs the question: how do you clear filters, buffers, etc., in that case to prevent pops/erratic operation when the user is jumping around in the track - if Reset() is not always called on stop/restart?
Like was mentioned in the KVR forum thread, I guess you will just have to trust the host provides you with sensible input audio (probably some amount of silence, maybe with some fade ins and fade outs) in those cases. If it doesn't, you might look into detecting the need for the reset by tracking the host playback position. (It's not a fool proof method, though, you can only guess based on that.)
__________________
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-07-2019 at 05:06 PM.
Xenakios is online now   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:52 PM.


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