From c469d514039f195091ff8cf57ac9fa3d67135859 Mon Sep 17 00:00:00 2001 From: ergz Date: Sun, 1 Oct 2023 23:44:37 -0700 Subject: [PATCH] wip - work on arp in progress --- basic.html | 1 + basic.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/basic.html b/basic.html index 8ac0ba7..737693b 100644 --- a/basic.html +++ b/basic.html @@ -76,6 +76,7 @@
+
diff --git a/basic.js b/basic.js index 10c9897..036de6e 100644 --- a/basic.js +++ b/basic.js @@ -130,4 +130,16 @@ window.onload = function () { osc.stop(); osc = null; }); + + document.getElementById("arp").addEventListener("click", () => { + const notes = ["C", "D", "E", "F", "G", "A", "B"]; + for (let i = 0; i < notes.length; i++) { + setTimeout(2000); + console.log(notes[i]); + osc.frequency.setValueAtTime( + noteToHz(notes[i]), + audioContext.currentTime + ); + } + }); };