From 8a4bca986c57062e96f1e58281b3eff52a856ee6 Mon Sep 17 00:00:00 2001 From: rekado Date: Tue, 6 Sep 2016 22:13:03 +0200 Subject: Initial commit. --- objects/env/ad m.axo | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 objects/env/ad m.axo (limited to 'objects/env') diff --git a/objects/env/ad m.axo b/objects/env/ad m.axo new file mode 100644 index 0000000..9ae76f1 --- /dev/null +++ b/objects/env/ad m.axo @@ -0,0 +1,60 @@ + + + attack decay envelope with modulation inputs + Ricardo Wurmus + GPL + env.axh + + + + + + + + + + + + + + + + + 0) && !ntrig) { + ntrig = 1; + stage = 1; +} else if (!(inlet_trig>0)) { + ntrig = 0; +} + +// decay +if (stage == 0) { + val = ___SMMLA(val,(-1<<26)+(param_d>>1)+(inlet_d>>1),val); + +// attack +} else { + int32_t a; + MTOF(- param_a - inlet_a,a); + + // shift to let val rise more slowly + a = a >> 4; + val = val + a; + + // switch to decay phase at max + if (val > 0x07FFFFFF) { + val = 0x07FFFFFF; + stage = 0; + } +} +outlet_env = val; +]]> + + -- cgit v1.2.3