frac32 cutoff frequency
frac32buffer input
frac32buffer output
bool32.tgl on
frac32.u.map freq
int32.hradio LP,BP,HP
int32_t valLP1;
int32_t valLP2;
int32_t valHP1;
int32_t valHP2;
valLP1 = 0;
valLP2 = 0;
valHP1 = 0;
valHP2 = 0;
// LP //
int32_t fLP1;
MTOF(param_freq + inlet_freq, fLP1);
// LP //
int32_t fLP2;
MTOF(param_freq + inlet_freq, fLP2);
// HP //
int32_t fHP1;
MTOF(param_freq + inlet_freq, fHP1);
// HP //
int32_t fHP2;
MTOF(param_freq + inlet_freq, fHP2);
// LP //
valLP1 = ___SMMLA((inlet_in - valLP1) << 1, fLP1, valLP1);
// LP //
valLP2 = ___SMMLA((valLP1 - valLP2) << 1, fLP2, valLP2);
int32_t SWITCHOUT;
switch (param_type > 0 ? param_type : 0) {
case 0:
SWITCHOUT = 0;
break;
case 1:
SWITCHOUT = valLP2;
break;
case 2:
SWITCHOUT = inlet_in;
break;
}
// HP //
valHP1 = ___SMMLA((SWITCHOUT - valHP1) << 1, fHP1, valHP1);
valHP2 = ___SMMLA((valHP1 - valHP2) << 1, fHP2, valHP2);
int32_t SWITCHOUT2;
switch (param_type > 0 ? param_type : 0) {
case 0:
SWITCHOUT2 = valLP2;
break;
case 1:
SWITCHOUT2 = valHP2;
break; // LP is routed thorugh the HP //
case 2:
SWITCHOUT2 = SWITCHOUT - valHP2;
break;
}
outlet_out = (param_on) ? SWITCHOUT2 : inlet_in;