quant

A k rate quantizer. The quant parameter and inlet (added together) correspond to the quant step. The quantization is to the "nearest quantization steps". Quantization is centered on zero. Example for quant = 4.00 Input Output 0 0 -1.9 0 +1.9 0 +2.1 4 +5.9 4 +6.1 8 -2.1 -4 -5.9 -4 -6.1 -8
Author: Smashed Transistors
License: LGPL
Github: tiar/kfunc/quant.axo

Inlets

frac32.bipolar in

frac32.positive quant

Outlets

frac32 out

Parameters

frac32.u.map quant

Control Rate
int32_t quant = param_quant + inlet_quant;
if (quant > 0)
  if (inlet_in > 0)
    outlet_out = ((inlet_in + (quant >> 1)) / quant) * quant;
  else if (inlet_in < 0)
    outlet_out = ((inlet_in - (quant >> 1)) / quant) * quant;
  else
    outlet_out = 0;
else
  outlet_out = inlet_in;

Privacy

© 2024 Zrna Research