diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..7a9dfa0 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/app.css b/app.css new file mode 100644 index 0000000..d0ca029 --- /dev/null +++ b/app.css @@ -0,0 +1,3 @@ +#synth-button { + display: none; +} \ No newline at end of file diff --git a/app.js b/app.js new file mode 100644 index 0000000..c547eac --- /dev/null +++ b/app.js @@ -0,0 +1,16 @@ +// element identifiers + +const element = document.getElementById("start-tone"); +const synthButton = document.getElementById("synth-button"); + +element.onclick = async () => { + await Tone.start() + .then(synthButton.style.display = "block"); +} + +const synth = new Tone.Synth().toMaster(); + +synthButton.onclick = () => { + synth.triggerAttackRelease("C4", "8n") +} + diff --git a/index.html b/index.html new file mode 100644 index 0000000..f464f6e --- /dev/null +++ b/index.html @@ -0,0 +1,15 @@ + + +
+ + + + +