From 7431d06f793966098c7c9820301284a3ccf9f76c Mon Sep 17 00:00:00 2001 From: ergz Date: Sat, 7 Oct 2023 01:27:15 -0700 Subject: [PATCH] ui updates --- synth.html | 6 +++--- synth.js | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/synth.html b/synth.html index 71bcb87..bd181aa 100644 --- a/synth.html +++ b/synth.html @@ -38,7 +38,7 @@ 0 - +
@@ -63,7 +63,7 @@
- +
@@ -88,7 +88,7 @@
- + diff --git a/synth.js b/synth.js index 3cb92de..a1a82f8 100644 --- a/synth.js +++ b/synth.js @@ -25,7 +25,7 @@ class Synth { this.gain = this.audioContext.createGain(); this.oscillators = [ this.createOscillator("sawtooth", 440, 0), - this.createOscillator("sawtooth", 435, 0), + this.createOscillator("sawtooth", 440, 0), this.createOscillator("sawtooth", 440, 0), ]; this.gain.connect(this.audioContext.destination); @@ -152,11 +152,11 @@ window.onload = function () { let osc1 = synth.oscillators[0]; if (osc1.isPlaying) { synth.stopOsc(osc1); - event.target.textContent = "Start"; + event.target.textContent = "On"; event.target.style.backgroundColor = "greenyellow"; } else { synth.startOsc(osc1); - event.target.textContent = "Stop"; + event.target.textContent = "Off"; event.target.style.backgroundColor = "red"; } }); @@ -169,11 +169,11 @@ window.onload = function () { let osc2 = synth.oscillators[1]; if (osc2.isPlaying) { synth.stopOsc(osc2); - event.target.textContent = "Start"; + event.target.textContent = "On"; event.target.style.backgroundColor = "greenyellow"; } else { synth.startOsc(osc2); - event.target.textContent = "Stop"; + event.target.textContent = "Off"; event.target.style.backgroundColor = "red"; } }); @@ -186,11 +186,11 @@ window.onload = function () { let osc3 = synth.oscillators[2]; if (osc3.isPlaying) { synth.stopOsc(osc3); - event.target.textContent = "Start"; + event.target.textContent = "On"; event.target.style.backgroundColor = "greenyellow"; } else { synth.startOsc(osc3); - event.target.textContent = "Stop"; + event.target.textContent = "Off"; event.target.style.backgroundColor = "red"; } });