rms meter

rms meter
Author: Smashed Transistors
License: LGPL
Github: tiar/env/rms_meter.axo

Inlets

frac32buffer in

frac32 pitch

Outlets

frac32 rms

Parameters

frac32.s.map pitch

Declaration
int32_t ms; // mean square
float rms;
Init
ms = 0;
rms = 0;
Control Rate
outlet_rms = arm::float_to_q(rms, 27);
rms = sqrtf(arm::q_to_float(ms, 27));
// low pass coefficient can be controlled by input pitch
uint32_t coef;
MTOFEXTENDED(param_pitch + inlet_pitch, coef);
coef >>= 3;
Audio Rate
ms = ___SMMLA(coef, (___SMMUL(inlet_in, inlet_in) << 5) - ms, ms);

Privacy

© 2024 Zrna Research