View Single Post
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,956
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