From 3385cfa726a12684083354052469decc9d2ab3f7 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 21 Dec 2019 17:19:08 +0700 Subject: [PATCH] Leave some notes on pitch/nuance gathering --- vocoder/static/vocoder.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/vocoder/static/vocoder.js b/vocoder/static/vocoder.js index bfcd6e8..694e049 100644 --- a/vocoder/static/vocoder.js +++ b/vocoder/static/vocoder.js @@ -104,8 +104,19 @@ function getSoundInfo() { **/ amplitude = recording.getPeaks(); duration = recording.duration(); - // pitch? + + // pitch (frequency?) I think we can use fft.analyze() and then find the + // highest value (0 -> 1024) that has a non-zero value this gives us the + // highest frequency from the recording + // https://p5js.org/reference/#/p5.FFT + // https://p5js.org/reference/#/p5.FFT/analyze + // nuance? + // "I meant the amount of variation in the voice - i.e is it one single + // monotone note or does it go up and down octaves or start soft and high and + // become deep and guttural etc." + // + // How do to do this? Unsure ... } class GeneratedShape { @@ -191,7 +202,7 @@ class GeneratedShape { * Show the shape on the canvas. **/ // TODO: use getSoundInfo function to influence how shape is drawn - ellipse(this.x, this.y, this.w, this.h); // TODO: experimenting for now ... + ellipse(this.x, this.y, this.w, this.h); } }