scaleInOut

arbitrary signal scaler with inMin and inMax, you set the width of the incoming signal (signal is clipped if incoming signal goes beyong the limits set by the inMin and inMax controls) with outMin and outMax, you set the width of the outgoing signal
Author: Remco van der Most
License: BSD
Github: sss/math/scaleInOut.axo

Inlets

frac32 in

Outlets

frac32 out

Parameters

frac32.s.map inMin

frac32.s.map inMax

frac32.s.map outMin

frac32.s.map outMax

Control Rate
float32_t width1 = param_inMax - param_inMin;
float32_t width2 = param_outMax - param_outMin;
float32_t ratio = width2 / width1;
int32_t in = inlet_in > param_inMax ? param_inMax : inlet_in;
in = in < param_inMin ? param_inMin : in;
outlet_out = (in - param_inMin) * ratio + param_outMin;

Privacy

© 2024 Zrna Research