sineslope

neutral shaper.. or something? The "clip" value will determine whether the output's behavior will be linear (below clip value) or sine-shaped. At the "clipping point", the module will turn from linear to sine-response at a 45degrees position (at that exact point a shift in time ia the same as the shift in amplitude, from there it curves a signal into sine-shape-> the only place a sine is at a 1/1 slope is at 45 degrees, so applying this will always give you a kind-off perfect slope)
Author: Remco van der Most
License: BSD
Github: sss/dist/sineslope.axo

Inlets

frac32buffer in

frac32 gain

frac32 clip

frac32 strength

Outlets

frac32buffer out

Parameters

frac32.u.map gain

frac32.u.map clipH

frac32.u.map clipL

frac32.u.map strength

bool32.tgl halfout

Declaration
int32_t pv1;
int32_t pv2;
Control Rate
float32_t STR = param_strength + inlet_strength >> 3;
STR = 3 + STR / (1 << 16);
int32_t gain = __USAT(param_gain + inlet_gain, 27);
Audio Rate
int32_t in = inlet_in;
in += ___SMMUL(in << 3, gain << 4);
int32_t A = in;
int32_t clipH = param_clipH + inlet_clip - (gain >> 2);
clipH = ___SMMUL(clipH << 3, clipH << 2);
int32_t clipL = param_clipL + inlet_clip - (gain >> 2);
clipL = ___SMMUL(clipL << 3, clipL << 2);
A = A > clipH ? clipH : A;
A = A < -clipL ? -clipL : A;
int32_t B = in - A;
int32_t r1;
if (B > 0) {
  SINE2TINTERP(((int32_t)((B >> 5) * STR) << 5) + (1 << 31), r1)
} else {
  SINE2TINTERP(((int32_t)((B >> 5) * STR) << 5) - (1 << 31), r1)
}
r1 = (r1 >> 2) / STR;
// r1=___SMMUL(r1>>1,(1<<27)-(param_gain>>2)<<2);
outlet_out = A - r1 >> param_halfout;

Privacy

© 2024 Zrna Research