modulatorMminM

General purpose modulator object with two masters. Used to modulate other object through other objects.
Author: Albert van der Zee
License: GPL
Github: azaxo/ctrl/modulatorMminM.axo

Inlets

frac32.bipolar ModIn

frac32.positive In

frac32.positive ModHeadroom

frac32.positive Master1Min

frac32.positive Master1

frac32.positive Master2

Outlets

frac32.positive output

Declaration
int32_t oud_in;
int32_t oud_parameter;
int32_t output;
Init
oud_in = 0;
oud_parameter = 0;
output = 0;
Control Rate
// modulate ModIn
int32_t accum = __SSAT(inlet_ModIn + inlet_In, 28);

// modulate ModHeadroom
accum = ___SMMLA((0x07FFFFFF - accum) << 3, inlet_ModHeadroom << 2, accum);

// apply master 1 control
accum = ___SMMUL(accum, inlet_Master1 > inlet_Master1Min ? inlet_Master1
                                                         : inlet_Master1Min);
accum = __SSAT((accum << 5), 28);

// apply master 2 control
accum = ___SMMUL(accum, inlet_Master2);
accum = __SSAT((accum << 5), 28);

// schrijf naar output
outlet_Out = accum;

Privacy

© 2024 Zrna Research