From d2e982fa529fc8883cef90cfca3a45d3a4aa8652 Mon Sep 17 00:00:00 2001 From: Mikayla Dobson <93477693+innocuous-symmetry@users.noreply.github.com> Date: Mon, 9 May 2022 11:46:35 -0500 Subject: [PATCH] tone connected --- .vscode/launch.json | 15 +++++++++++++++ app.css | 3 +++ app.js | 16 ++++++++++++++++ index.html | 15 +++++++++++++++ requireTone.js | 3 +++ 5 files changed, 52 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 app.css create mode 100644 app.js create mode 100644 index.html create mode 100644 requireTone.js 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 @@ + + +
+ + + + +