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