quadVCA

quad "voltage controlled amplifier", multiplies v and a inputs, with linear interpolation from k- to s-rate
Author: Johannes Taelman edit by Remco van der Most
License: BSD
Github: sss/gain/quadVCA.axo

Inlets

frac32buffer audio input

frac32buffer a2

frac32buffer a3

frac32buffer a4

frac32 gain input

frac32 v2

frac32 v3

frac32 v4

Outlets

frac32buffer output

Declaration
int32_t prev1;
int32_t step1;
int32_t prev2;
int32_t step2;
int32_t prev3;
int32_t step3;
int32_t prev4;
int32_t step4;
Control Rate
step1 = (inlet_v1 - prev1) >> 4;
int32_t i1 = prev1;
prev1 = inlet_v1;

step2 = (inlet_v2 - prev2) >> 4;
int32_t i2 = prev2;
prev2 = inlet_v2;

step3 = (inlet_v3 - prev3) >> 4;
int32_t i3 = prev1;
prev3 = inlet_v3;

step4 = (inlet_v4 - prev4) >> 4;
int32_t i4 = prev4;
prev4 = inlet_v4;
Audio Rate
i1 += step1;
i2 += step2;
i3 += step3;
i4 += step4;

outlet_o = ___SMMUL(inlet_a1, i1) << 5;
outlet_o += ___SMMUL(inlet_a2, i2) << 5;
outlet_o += ___SMMUL(inlet_a3, i3) << 5;
outlet_o += ___SMMUL(inlet_a4, i4) << 5;

Privacy

© 2024 Zrna Research