digiana

digital LQ remake of a comparing amplifier/filter. module compares incoming audio with the filtered signal and adds/subtracts a digital value to/from the filtered signal input depending on whether the incoming audio signal is higher/lower then the filtered signal. saturate/volume control the clipping and volume of the signal rate controls the frequency of the lowpass filters.
Author: Remco van der Most
License: BSD
Github: sss/dist/digiana.axo

Inlets

frac32buffer i1

Outlets

frac32buffer o1

Parameters

frac32.u.map saturate

frac32.u.map volume

frac32.s.map.pitch rate

Declaration
int32_t out;
int32_t val1;
int32_t val2;
int32_t val3;
int32_t val4;
int32_t in[4];
int32_t prev;
int32_t diff;
Control Rate
int32_t freq;
MTOFEXTENDED(param_rate, freq)
Audio Rate
// diff=(inlet_i1-prev)>>2;
in[0] = prev + ((inlet_i1 - prev) >> 2);
in[1] = prev + ((inlet_i1 - prev) >> 1);
in[2] = prev + (inlet_i1 - prev) * 3 / 4;
in[3] = inlet_i1;
out = (in[0] >> 2) > ___SMMUL(val1 << 3, (1 << 27) - param_saturate << 2)
          ? (param_volume)
          : -(param_volume);
val1 = ___SMMLA((out - val1) << 1, freq, val1);
out = (in[1] >> 2) > ___SMMUL(val1 << 3, (1 << 27) - param_saturate << 2)
          ? (param_volume)
          : -(param_volume);
val1 = ___SMMLA((out - val1) << 1, freq, val1);
out = (in[2] >> 2) > ___SMMUL(val1 << 3, (1 << 27) - param_saturate << 2)
          ? (param_volume)
          : -(param_volume);
val1 = ___SMMLA((out - val1) << 1, freq, val1);
out = (in[3] >> 2) > ___SMMUL(val1 << 3, (1 << 27) - param_saturate << 2)
          ? (param_volume)
          : -(param_volume);
val1 = ___SMMLA((out - val1) << 1, freq, val1);
val2 = ___SMMLA((val1 - val2) << 1, freq, val2);
outlet_o1 = val2;
prev = inlet_i1;

Privacy

© 2024 Zrna Research