xxxxxxxxxx
40
let soundAnalyser;
let mic;
function setup() {
console.log('hello');
//Tone.start();
//Tone.context.resume();
createCanvas(400, 400);
soundAnalyser= new Tone.Analyser(fft,64);
mic = new Tone.UserMedia().connect(soundAnalyser);
}
function draw() {
// mic.open().then(() => {
// // promise resolves when input is available
// console.log("mic open");
// console.log(soundAnalyser);
// }).catch(e => {
// // promise is rejected when the user doesn't have or allow mic access
// console.log("mic not open");
// });
background(20);
// for(let i; i<soundAnalyser.length;i++){
// let amp= soundAnalyser[i];
// let y = map(amp,0,256,height,0);
// fill(i,0,0);
// rect(i*width/64,y,width/64,y);
// }
}