Is it possible to use envelope to modify a Midi noteOn velocity or any other value?

Status
Not open for further replies.

Coyne

Member
Hi there. Amazing library. A big thanks to Paul and others involved who created it.

Ive been searching this forum but cant find any info on this topic. I hope any of you can give me a tip or point me in the right direction. :)

Is it possible to use the audio library (envelope) to modify values instead of audio?
Im wondering if its possible to pipe a value trough the envelope without using an audio object. Or if its possible to use any audio object to feed the envelope a value like in my case from midi noteOn Velocity and modify it with the envelope (Attack,Decay,sustain,release) and then use the modified value in other parts of the code? in my case i want to use it to adjust te color and alpha of an ws2812 led strip.

Read something that it was possible to feed the envelope to a rms or peak object to get the value out to use in other parts of code?

Thanks in advance guys. best regards Coyne
 
The audio library is designed primarily to pass audio data only between its objects. There are 2 special queue objects, which are meant to be the way to get data transfer between the library and your program.

For LED data, you're probably better off just copying code from the audio library, or writing it yourself, rather than trying to match the rate between audio samples and LED updates.

The RMS and peak analysis objects take audio data in and give you numbers out, using available() to check when new results have been computed, and read() to fetch the info. So in that regard, they already do what you asked. Or maybe you meant something else and I've just misunderstood?
 
Hi Paul.
Thanks for answering. What i was hoping to do is: a Midi noteOn with a velocity of lets say 127 and then modify that value with an "envelope" to get a sort of fade in and out according to the envelopes attack, decay, sustain release then multiply that value * 2 and feed it to the led strip hence r.g.b values max at 256. Coping the code from the audio library you say. Any hint of what i need. A bit over my level of knowledge :(.
Thankful for any tips
 
wouldnt it be possible to feed the audio library with a noteOn value instead of the likes of AudioInputAnalog adc1(A3);? Maybee im out cycling and are in way over my head. Just tell me then ;)
 
Status
Not open for further replies.
Back
Top