sensorium / Mozzi

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

How do you do filter envelopes? #265

Closed justinjools22 closed 3 months ago

justinjools22 commented 4 months ago

The envelope examples are amplitude envelopes, so how do you use envelopes with filters. I am building a design with both amplitude and filter envelopes.

tomcombriat commented 4 months ago

A quick answer, can elaborate more of needed.

The envelopes just return numbers. You can use these numbers to adjust the filter parameters, something like (pseudo code) lpf.setCutoff(envelope.next());

justinjools22 commented 4 months ago

Ah I see. Perfect. So you use lpf.setCutoff(envelope.next()); then the separate ADSR values are sent to calculate the waveform. Thanks :)

tomcombriat commented 4 months ago

Great! Actually an example on that would be great! PR welcome ;)

Can I close this as solved?