StOutShelved

Audio output, stereo has inbuild volume control and filter-shelving to adjust the spectral slope The filter can easily go into self-oscillation when the high shelf is accentuated.
Author: Johannes Taelman edit by Remco van der Most
License: BSD
Github: sss/audio/StOutShelved.axo

Inlets

frac32buffer Left channel

frac32buffer Right channel

Outlets

None

Parameters

frac32.u.map volume

frac32.s.map.pitch mid

frac32.s.map shelf

frac32.u.map.gain feed

Displays

frac32.vu vuLeft

frac32.vu vuRight

Declaration
int32_t lpl, lpr, fdl, fdr;
Control Rate
int32_t frq;
MTOF(param_mid, frq)

int j;
for (j = 0; j < BUFSIZE; j++) {
  int32_t inl = inlet_left[j] + fdl;
  int32_t inr = inlet_right[j] + fdr;
  lpl = ___SMMLA(inl - lpl << 1, frq, lpl);
  lpr = ___SMMLA(inr - lpr << 1, frq, lpr);
  int32_t tmpl = (lpl << 1) - inl;
  int32_t tmpr = (lpr << 1) - inr;
  inl += ___SMMUL(((inl + lpl) >> 1) - inl, -param_shelf) << 5;
  inr += ___SMMUL(((inr + lpr) >> 1) - inr, -param_shelf) << 5;
  fdl = __SSAT(___SMMUL(inl - inlet_left[j], param_feed) << 1, 27);
  fdr = __SSAT(___SMMUL(inr - inlet_right[j], param_feed) << 1, 27);
  AudioOutputLeft[j] = __SSAT(___SMMUL(inl << 3, param_volume << 2), 28);
  AudioOutputRight[j] = __SSAT(___SMMUL(inr << 3, param_volume << 2), 28);
}
disp_vuLeft = AudioOutputLeft[0];
disp_vuRight = AudioOutputRight[0];

Privacy

© 2024 Zrna Research