AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.Hi guys, I'm pretty new at this.
I'm working on a waveform generator that displays the wave visually.
Github: https://github.com/djleprechaunz/OscProject (https://github.com/djleprechaunz/OscProject)
Currently I'm wanting to implement and attack/release compressor, so it looks like I need to create a Envelope follower first.
So I figure it's a basic RMS of the (bufferSize) samples before it:
Here's my function:
- Code: Select all (#)
public double getValue(double t)
Iterator<Double> itr = buffer.iterator();
double sum = 0;
double value = itr.next();
sum += Math.pow(value, 2.0);
sum = sum/buffer.size();
sum = Math.sqrt(sum);
here's what it displays
increasing the buffer size doesn't help.
Have I totally misunderstood how I implement an envelope follower, or am I on the right track?