wrapper

Folds back the signal when it passes the "width" value and scales back the result to normal range. "mix" mixes between original and changed signal
Author: Remco van der Most
License: BSD
Github: sss/dist/wrapper.axo

Inlets

frac32 width

frac32 mix

frac32buffer in

Outlets

frac32buffer out

Parameters

frac32.u.map width

frac32.u.map mix

Control Rate
float32_t scaleback =
    ((float32_t)(1 << 27)) / ((float32_t)(param_width + inlet_width));
int32_t width0 = param_width + inlet_width;
int32_t width1 = (param_width + inlet_width) << 1;
int32_t width2 = (param_width + inlet_width) << 2;
int32_t mix = (param_mix + inlet_mix);
mix = mix > 0 ? mix : -mix;
mix = mix > (1 << 27) ? (2 << 27) - mix : mix;
int32_t miix = mix << 3;
mix = ((1 << 27) - mix) << 3;
Audio Rate
int32_t shift = inlet_in + width0;
shift = shift > 0 ? shift : -shift;
int32_t wrap = shift - ((shift / width2) * width2);
int32_t bounce = wrap > width1 ? (width2 - wrap) : wrap;
outlet_out =
    ___SMMUL(miix, ((((int32_t)((bounce - width0) * scaleback))) << 2)) +
    ___SMMUL(mix, inlet_in << 2);

Privacy

© 2024 Zrna Research