bool32.risingfalling trigger
frac32.positive a
frac32.positive d
bool32.rising reset
frac32.positive envelope output
bool32 state
spinner ascale
spinner dscale
spinner declick
int32_t val;
val = 0;
if (inlet_gate > 0) {
int32_t t;
MTOF(-inlet_a, t);
val += (inlet_a) ? t >> attr_ascale : 1 << (27 - attr_declick);
} else {
int32_t t;
MTOF(-inlet_d, t);
val -= t >> attr_dscale;
}
val = __USAT(val, 27);
if (inlet_reset)
val = 0;
outlet_env = val;
outlet_state = bool(val);