EDIT: edited inquiry to reflect forum structure
I’m having a blast trying out the Lua scripting for the Prototype module. I have very minimal experience with DSP, mostly using Reaktor and JSFX. A question… perhaps due to my lack of familiarity with the VCV Prototype paradigm or DSP in general (I’m very much in the copy/pasting phase).
I hit a roadblock when implementing a 1-pole high pass filter. The last bits are:
lp_outl = 2*filterinput*lp_a0 + lp_outl*lp_b1 filteroutput = (filterinput-lp_outl)*outgain
And I get the following error:
attempt to perform arithmetic on global 'lp_outl' (a nil value)
I presume this is because I am using a recursive definition, but I don’t quite understand the fix.
Additionally, can someone shed some light on when it is appropriate to define variables in the body of function process(block) vs … block.bufferSize do. In JSFX, there is space for performing math on parameters at the control rate vs the samplerate, but I am unclear on where those distinctions lie in the Lua scripting model.