symSin

Symmetrical sineshaper with treshold. Above the value set by the knob, the signal will turn into a sine-shape. At this treshold the sineshaper will be at 45degrees, thus at a 1:1 ratio, before curving the signal. This module is alike the sinelord module, but only has a single control for both positive and negative treshold. Use "asymSin" for asymmetrical distortion.
Author: Remco van der Most
License: BSD
Github: sss/dist/symSin.axo

Inlets

frac32 mod

frac32buffer in

Outlets

frac32buffer out

Parameters

frac32.s.map mod

Declaration
int32_t O1;
Init
SINE2TINTERP(1 << 30, O1)
Control Rate
int32_t mod1a = param_mod + inlet_mod;
int32_t mod1b = mod1a < 0 ? -mod1a : 0;
mod1a = mod1a > 0 ? mod1a : 0;
Audio Rate
int32_t in = inlet_in;
in += ___SMMUL(mod1b << 4, in << 4);
int32_t clip = in > mod1a ? mod1a : in;
clip = clip < -mod1a ? -mod1a : clip;
int32_t over = in - clip;
if (over > 0) {
  SINE2TINTERP((-over << 4) + (1 << 30), over)
  over = over >> 5;
  over -= O1 >> 5;
} else {
  SINE2TINTERP((-over << 4) - (1 << 30), over)
  over = over >> 5;
  over += O1 >> 5;
}
outlet_out = clip + over;

Privacy

© 2024 Zrna Research