This commit is contained in:
2023-09-30 23:22:32 -07:00
commit ce1a3c5ce1
7 changed files with 2566 additions and 0 deletions

14
index.ts Normal file
View File

@@ -0,0 +1,14 @@
window.onload = function () {
const audioContext: AudioContext = new AudioContext();
const osc: OscillatorNode = audioContext.createOscillator();
// this gets the node for the start butten and adds to it an even listener for click, when clicked the synth will play
document.getElementById("play")!.addEventListener("click", () => {
audioContext.resume();
});
osc.type = "square";
osc.frequency.setValueAtTime(220, audioContext.currentTime);
osc.connect(audioContext.destination);
osc.start();
};