I am trying to understand how to create an “Envelope Effect” and modify it. I managed to create one with “maximilian library” but i had to use the synthesiser to trigger the envelope in startnote and stopnote methods. But i want to make something that it is going to trigger the envelope both when the dB level of audio is higher than a certain level (-18dB for example) and when there is a button press event.
Is there a method that lets me to read the dB or volume of the audio so that i will be able to trigger the envelope in a “if condition” when level is higher than the treshold value.
I have one more question. The audioplugin app and the synthesiser examples have different processing sections.I can see that they are connected and as you know one is “renderNextBlock” in synthesiser voice and the other one is " processBlock " in audioProcessor. the renderNextBlock is where i create the osc signals and apply the envelope effect. And the process is where i normally create channels and read&write the outpuData . My question is , how am i going to conbine these two? Because i want my app to be able to get sounds and apply the envelope effect when it is triggered by the treshold value. And when there isn’t a sound file in my daw’s track i want it to be able to apply the envelope effect when a midi button is pressed.
I hope that i could express my thoughts