character

Clipping distortion based on a lowpass filter. Will lower the filter cutoff to 0hz when reaching maximum levels. pitch: controls maximum filter cutoff (no ducking) Strength: controls the strength/rate of the ducking->lowering the maximum output level. Gain: adds gain to the input signal AND signal controlling the clipping Clip: adds gain only to the signal controlling the clipping Quant: quantizes the signal controlling the clipping. The strength, clip and quant controls could be seen as "character" controls, changing the respective amplitudes of the created overtones, creating different distortions. The gain control nicely warps this distortion-character up the frequency spectrum.
Author: Remco van der Most
License: BSD
Github: sss/math/character.axo

Inlets

frac32buffer input

frac32 strength

frac32 gain

frac32 clip

frac32 quant

Outlets

frac32buffer output

Parameters

frac32.s.map.pitch freq

frac32.u.map strength

frac32.u.map gain

frac32.u.map clip

frac32.u.map quant

Declaration
int32_t val;
Init
val = 0;
Control Rate
int32_t f;

int32_t quant = __USAT(param_quant + inlet_quant, 27);
quant = ___SMMUL(quant << 3, quant << 2) + 1;
int32_t gain = __USAT(param_gain + inlet_gain, 28);
int32_t strength = __USAT(param_strength + inlet_strength, 27);
strength = ___SMMUL(strength << 3, (62 << 23));
int32_t clip = __USAT(param_clip + inlet_clip, 27);
Audio Rate
int32_t av = val + inlet_in + ___SMMUL(gain << 3, inlet_in << 3) >> 1;
av = av / quant * quant;
av = __SSAT(av + ___SMMUL(av << 4, clip << 3), 28);
av = (av > 0 ? av : -av);
av = ___SMMUL(av << 3, av << 2);
av = ___SMMUL(av << 3, av << 2);
av = (1 << 27) - ___SMMUL(___SMMUL(av << 3, av << 2) << 3, strength << 2);
MTOF(param_freq, f);
f = ___SMMUL(av << 3, f) << 2;
val = ___SMMLA((inlet_in - val) << 1, f, val);
outlet_out = val;

Privacy

© 2024 Zrna Research