Dcrv

curved decay envelope. anti-clockwise: exponential clockwise: inverse exponential
Author: Remco van der Most
License: BSD
Github: sss/env/Dcrv.axo

Inlets

bool32.rising trigger

Outlets

frac32.positive envelope output

Parameters

frac32.s.map.klineartime.exp d

frac32.s.map curveD

Declaration
int8_t stage;
int ntrig;
int32_t val;
Init
ntrig = 0;
val = 0;
Control Rate
int32_t crv1;
int32_t crv2;
int32_t t;
crv2 = param_curveD;
MTOF(-(param_d << 1) + ___SMMUL(val - (1 << 30), -crv2 << 2), t);

val = __USAT(val - (t >> 3), 31);

if ((inlet_trig > 0) && !ntrig) {
  val = (1 << 31);
  ntrig = 1;
  stage = 1;
} else if (!(inlet_trig > 0)) {
  ntrig = 0;
}

outlet_env = val >> 4;

Privacy

© 2024 Zrna Research