These sines are taking a beating...
let m = maximilian();
let myOsc = new m.maxiOsc();
let myOtherOsc = new m.maxiOsc();
let maxiAudio = new m.maxiAudio();
/**
* maxiAudio.init() initialises the Audio Context and should execute in a button click event handler to prevent the console warning
* "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu"
*/
let playAudio = () => {
maxiAudio.init();
maxiAudio.play = function () {
// these two sines will beat together. They're now a bit too loud though..
return myOsc.sinewave(440) + myOtherOsc.sinewave(441);
}
}
const playButton = document.getElementById('playButton');
playButton.addEventListener("click", () => playAudio());