adsr-noteoff

81 views
Skip to first unread message

Daniel Llermaly

unread,
Sep 20, 2022, 12:28:13 PM9/20/22
to Mozzi-users
Hi friends
I have continued exploring the envelopes in mozzi and it is becoming clearer to me where it works.
The doubt I have now is that according to what I understood, the release of the envelope would only be activated when receiving the note off message. But what I saw in practice is that after the sustain time the release begins, regardless of whether the noteoff has not been sent yet.
I was able to solve this by setting a very high sustain time (infinity would be best) but I guess there is a more elegant way to set this.
Am I using the envelope tools correctly?
Greetings and thank you very much

Daniel

tangiblewaves

unread,
Sep 20, 2022, 1:45:47 PM9/20/22
to mozzi-users
I encountered this behaviour too (quite some time ago). The sustain handling seems a bit odd in mozzi, because sustain is a level, not a time. It's the level where the envelope remains until gate off, then, the release starts down to level 0.


--
You received this message because you are subscribed to the Google Groups "Mozzi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozzi-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/57497776-2f89-401c-bed0-9316a40248e5n%40googlegroups.com.

tomco...@live.fr

unread,
Sep 20, 2022, 2:07:30 PM9/20/22
to Mozzi-users
Hi Daniel,

This behavior is standard for an ADSR, it allows for short percussive sound that rings a bit after the initial hit for instance.
One workaround is the one you found, setting a very long sustain time. This PR (https://github.com/sensorium/Mozzi/pull/95) might be of interest if you cannot set it high enough.
Another one (which has been in my mind for some time, but not tried, should work) is to stop using the ADSR once it is in sustain phase (and replace adsr.next() by the sustain value). I see now while browsing the API that the ADSR class does not have a getter for the phase, this can be easily corrected, I might commit myself to that.

@tangib: note that you can both setSustainLevel and setSustainTime (see https://sensorium.github.io/Mozzi/doc/html/class_a_d_s_r.html#a764566274a3982b43cb1f9fb47ca06ae).

Hope it helps,

tangiblewaves

unread,
Sep 20, 2022, 2:20:45 PM9/20/22
to mozzi-users
Thanks Daniel for the hint with sustain-time and -level! I hadn't remembered this, my last work with mozzi was some years ago ;-) Anyway, a real, classic ADSR envelope stays at sustain level until gate goes low. Sustain time is an interesting but unusual addition in mozzi but I'd expect the ususal behaviour when e.g. sustain time is <0 or another indicator that it shouldn't be used.
Maybe I can find the modification I made; then I'll share it here.

Petr Molhanec

unread,
Sep 20, 2022, 8:40:10 PM9/20/22
to mozzi...@googlegroups.com
Envelope : RT Trig on - (
If true-  set duration go fixed
Elise go  Atak -Dkey
If LVLDk,ey.=<LVLsus  And key Is Down ( or no note off)
Go sustain
Till true =key Is up  or no note off
Go release 

Jíst try to algorhyming


Dne út 20. 9. 2022 18:28 uživatel Daniel Llermaly <daniel....@gmail.com> napsal:
--
Reply all
Reply to author
Forward
0 new messages