Browse Source

Start to collect parameters and wire up shape generation

main
Luke Murphy 5 years ago
parent
commit
53c19dda03
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 23
      vocoder/static/vocoder.js

23
vocoder/static/vocoder.js

@ -11,10 +11,7 @@ var serverUrl = 'http://localhost:5000';
var archiveUrl = serverUrl + '/add-to-archive/'; var archiveUrl = serverUrl + '/add-to-archive/';
var mic, recorder, soundFile; var mic, recorder, soundFile;
var state = 0; var recordingTimeout = 30000; // 30 seconds (in milliseconds)
// 30 seconds (in milliseconds)
var recordingTimeout = 30000;
function setupRecording(){ function setupRecording(){
mic = new p5.AudioIn(); mic = new p5.AudioIn();
@ -76,6 +73,24 @@ function setupRecording(){
playButton.mousePressed(doArchiving); playButton.mousePressed(doArchiving);
} }
function collectSoundParamters(){
// TODO: collect all the sound parameters
// [x] amplitude
// [x] length of sound
// [ ] pitch
// [ ] nuance
// btw, there is no "nuance" function for p5js. My current guess is to
// perhaps measure it from the "getPeaks". For all wave peaks measured,
// ??? (need to think this through, not really sure ...)
amplitude = soundFile.getPeaks();
duration = soundFile.duration();
}
function generateShape(){
// TODO: take in sound parameters and generate a shape
ellipse(100, 100, 25, 25);
}
function setup(){ function setup(){
// TODO: Replace this with the leaflet/mappa setup just // TODO: Replace this with the leaflet/mappa setup just
// using this for now to draw something to experiment on // using this for now to draw something to experiment on

Loading…
Cancel
Save