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

How do you do filter envelopes? #265

Open justinjools22 opened 1 week ago

justinjools22 commented 1 week 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 1 week 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 1 week 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 1 week ago

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

Can I close this as solved?