mm6db

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

Inlets

frac32 cutoff frequency

frac32buffer input

Outlets

frac32buffer output

Parameters

int32.hradio LP,BP,HP

bool32.tgl on

frac32.u.map freq

Declaration
int32_t valLP;
int32_t valHP;
Init
valLP = 0;
valHP = 0;
Control Rate
// LP //
int32_t fLP;
MTOF(param_freq + inlet_freq, fLP);

// HP //
int32_t fHP;
MTOF(param_freq + inlet_freq, fHP);
Audio Rate
// LP //
valLP = ___SMMLA((inlet_in - valLP) << 1, fLP, valLP);

int32_t SWITCHOUT;
switch (param_type > 0 ? param_type : 0) {
case 0:
  SWITCHOUT = 0;
  break;
case 1:
  SWITCHOUT = valLP;
  break;
case 2:
  SWITCHOUT = inlet_in;
  break;
}

// HP //
valHP = ___SMMLA((SWITCHOUT - valHP) << 1, fHP, valHP);

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

outlet_out = (param_on) ? SWITCHOUT2 : inlet_in;

Privacy

© 2024 Zrna Research