From b84eb103102328529d1d9fb1acf31d56c2299bfb Mon Sep 17 00:00:00 2001
From: Mikayla Dobson <93477693+innocuous-symmetry@users.noreply.github.com>
Date: Mon, 9 May 2022 20:07:10 -0500
Subject: [PATCH] converting some html elements for ts compatibility
---
built/src/harmonyUtil.js | 4 ++--
built/src/inputHandling.js | 24 ++++++++++++++--------
index.html | 6 +++---
src/{inputHandling.js => inputHandling.ts} | 24 ++++++++++++++--------
4 files changed, 37 insertions(+), 21 deletions(-)
rename src/{inputHandling.js => inputHandling.ts} (67%)
diff --git a/built/src/harmonyUtil.js b/built/src/harmonyUtil.js
index 71944c3..1ba6c6f 100644
--- a/built/src/harmonyUtil.js
+++ b/built/src/harmonyUtil.js
@@ -11,9 +11,9 @@ const intervals = {
// all intervals beyond this invert to one of the previous intervals
};
// helper functions
-const transposePitches = (pitchNames, interval) => {
+const transposePitches = (pitches, interval) => {
let transposed = [];
- pitchNames.forEach(pitch => transposed.push((pitch + interval) % 12));
+ pitches.forEach(pitch => transposed.push((pitch + interval) % 12));
return transposed;
};
const findVector = (pitches) => {
diff --git a/built/src/inputHandling.js b/built/src/inputHandling.js
index 7841d5a..4477d97 100644
--- a/built/src/inputHandling.js
+++ b/built/src/inputHandling.js
@@ -19,31 +19,39 @@ const bassLFOTarget = document.getElementById('bass-lfo-target');
// logic for displaying values on HTML labels
// S
sopranoVol.oninput = (e) => {
- sopranoVolTarget.innerHTML = e.target.value;
+ const target = e.target;
+ sopranoVolTarget.innerHTML = target.value;
};
sopLFO.oninput = (e) => {
- sopLFOTarget.innerHTML = ` ${e.target.value} Hz.`;
+ const target = e.target;
+ sopLFOTarget.innerHTML = ` ${target.value} Hz.`;
};
// A
altoVol.oninput = (e) => {
- altoVolTarget.innerHTML = e.target.value;
+ const target = e.target;
+ altoVolTarget.innerHTML = target.value;
};
altoLFO.oninput = (e) => {
- altoLFOTarget.innerHTML = ` ${e.target.value} Hz.`;
+ const target = e.target;
+ altoLFOTarget.innerHTML = ` ${target.value} Hz.`;
};
// T
tenVol.oninput = (e) => {
- tenVolTarget.innerHTML = e.target.value;
+ const target = e.target;
+ tenVolTarget.innerHTML = target.value;
};
tenLFO.oninput = (e) => {
- tenLFOTarget.innerHTML = ` ${e.target.value} Hz.`;
+ const target = e.target;
+ tenLFOTarget.innerHTML = ` ${target.value} Hz.`;
};
// B
bassVol.oninput = (e) => {
- bassVolTarget.innerHTML = e.target.value;
+ const target = e.target;
+ bassVolTarget.innerHTML = target.value;
};
bassLFO.oninput = (e) => {
- bassLFOTarget.innerHTML = ` ${e.target.value.toString()} Hz.`;
+ const target = e.target;
+ bassLFOTarget.innerHTML = ` ${target.value} Hz.`;
};
// audio-adjacent input handling
const synthButton = document.getElementById('synth-button');
diff --git a/index.html b/index.html
index d0f15eb..5562843 100644
--- a/index.html
+++ b/index.html
@@ -118,9 +118,9 @@
-
-
-
+
+
+