d m

decay envelope with modulation input
Author: Johannes Taelman
License: BSD
Github: env/d m.axo

Inlets

bool32.rising trigger

frac32 decay time

Outlets

frac32.positive envelope output

Parameters

frac32.s.map.klineartime.exp d

Declaration
int32_t val;
int ntrig;
Init
val = 0;
ntrig = 0;
Control Rate
if ((inlet_trig > 0) && !ntrig) {
  val = 1 << 27;
  ntrig = 1;
} else {
  if (!(inlet_trig > 0))
    ntrig = 0;
  int32_t in = -inlet_d - param_d;
  int32_t c;
  MTOFEXTENDED(in, c);
  c = 0x7FFFFFFF - (c >> 2);
  val = ___SMMUL(val, c) << 1;
}
outlet_env = val;

Privacy

© 2024 Zrna Research