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: 396
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: 8,062
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.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 12-29-2018 at 10:02 AM.
Xenakios is offline   Reply With Quote
Old 12-29-2018, 10:02 AM   #3
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
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: 8,062
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.
__________________
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 12-29-2018, 10:26 AM   #5
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
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: 8,062
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.
__________________
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
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 01:12 PM.


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