Calculate pitch
This commit is contained in:
parent
db26aec15f
commit
1aac136c65
@ -419,3 +419,14 @@ function windowResized() {
|
||||
**/
|
||||
resizeCanvas(windowWidth, windowHeight);
|
||||
}
|
||||
|
||||
function getMaxPitch(spectrum) {
|
||||
/**
|
||||
* Get max pitch.
|
||||
*/
|
||||
for (let x = spectrum.length - 1; x > 0; x--) {
|
||||
if (spectrum[x] != 0) {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user