Minim
Minim copied to clipboard
How to normalize input?
I am trying to draw a waveform using microphone input, and I'd like to narrow the dynamic range of the prior to drawing the waveform. I'm working on an app where a lively waveform is important, so if user A has a low volume coming into the app, and user B has a really loud volume coming into the app, they each get a relatively consistent waveform.
I've combed the docs but I'm still not quite sure if this is possible.
I'll answer my own question, here's a quick example:
public void draw() {
table = new Wavetable(out.mix.toArray());
table.normalize();
println(table.getWaveform()[***any array index***]);
}
Hope this helps someone.