sensorium / Mozzi

sound synthesis library for Arduino
https://sensorium.github.io/Mozzi/
GNU Lesser General Public License v2.1
1.05k stars 184 forks source link

Mozzi envelope how to produce long note #264

Open justinjools22 opened 2 weeks ago

justinjools22 commented 2 weeks ago

Hi, I have been playing around with the ADSR_Audio_Rate_Envelope example. I thought by setting the attack, decay, sustain, release manually with values e.g. 100, 1000, 1000, 500 I would be able to produce a long string like sound that lasts for a few seconds but it produces a jittery sound. So it seems that is some other parameter at play. I would just like to emulate a long note to understand how it works. Is there something like Envelope.NoteHold or midi note length/time so the code waits before starting new note.

tomcombriat commented 2 weeks ago

Hi! The envelopes come with a third template parameter which is useful for producing long notes, have you tried this example? []()

justinjools22 commented 2 weeks ago

I got it working with random values but as soon as I add static values it produces a long consistent drone. Will pay around with it. Thanks.

tomcombriat commented 2 weeks ago

You can also try to play with the parameter of noteOn(https://sensorium.github.io/Mozzi/doc/html/class_a_d_s_r.html#aef8d9c2799485fcd5a854228503f9f2f), resetting the phase of the envelope might be what you are looking for?

tomcombriat commented 1 week ago

Hi! Is this solved?