mm18db

1st order multimode X3 (18db). Lp,Bp,Hp.
Author: Jaffasplaffa (Original by Johannes Taelman)
License: BSD
Github: jaffa/filt/mm18db.axo

Inlets

frac32buffer input

frac32 cutoff frequency

Outlets

frac32buffer output

Parameters

bool32.tgl on

frac32.u.map freq

int32.hradio LP,BP,HP

Declaration
int32_t valLP1;
int32_t valLP2;
int32_t valLP3;
int32_t valHP1;
int32_t valHP2;
int32_t valHP3;
Init
valLP1 = 0;
valLP2 = 0;
valLP3 = 0;
valHP1 = 0;
valHP2 = 0;
valHP3 = 0;
Control Rate
// 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);

// 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);
Audio Rate
// LP //
valLP1 = ___SMMLA((inlet_in - valLP1) << 1, fLP1, valLP1);
valLP2 = ___SMMLA((valLP1 - valLP2) << 1, fLP2, valLP2);
valLP3 = ___SMMLA((valLP2 - valLP3) << 1, fLP3, valLP3);

int32_t SWITCHOUT;
switch (param_type > 0 ? param_type : 0) {
case 0:
  SWITCHOUT = 0;
  break;
case 1:
  SWITCHOUT = valLP3;
  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);

int32_t SWITCHOUT2;
switch (param_type > 0 ? param_type : 0) {
case 0:
  SWITCHOUT2 = valLP3;
  break;
case 1:
  SWITCHOUT2 = valHP3;
  break; // LP is routed thorugh the HP //
case 2:
  SWITCHOUT2 = SWITCHOUT - valHP3;
  break;
}

outlet_out = (param_on) ? SWITCHOUT2 : inlet_in;

Privacy

© 2024 Zrna Research