From e9c29c777a01cd6fd686ef973bd4b5e8e080d2b3 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Fri, 7 Feb 2020 12:53:53 +0100 Subject: [PATCH] Store the maximum pitch --- voicegardens/static/voicegardens.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voicegardens/static/voicegardens.js b/voicegardens/static/voicegardens.js index 8d23058..360324c 100644 --- a/voicegardens/static/voicegardens.js +++ b/voicegardens/static/voicegardens.js @@ -77,7 +77,7 @@ function stop() { newSoundJustRecorded = true; // https://p5js.org/reference/#/p5.FFT/analyze - pitch = fft.analyze(); + pitch = getMaxPitch(fft.analyze()); // https://p5js.org/reference/#/p5.SoundFile/getPeaks amplitude = recording.getPeaks(1)[0] * 100;