Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to normalize input? #108

Open
joshbg2k opened this issue Mar 29, 2020 · 1 comment
Open

How to normalize input? #108

joshbg2k opened this issue Mar 29, 2020 · 1 comment

Comments

@joshbg2k
Copy link

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.

@joshbg2k
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant