summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-03-09 23:38:07 -0400
committerBrian Cully <bjc@spork.org>2025-03-09 23:38:07 -0400
commit32c3d85afe767ceaefb26f0cadd962793d3de642 (patch)
tree7e5197256fd3a958969953f14099f16cc82f4b75
parentdc9f5c34c4b09afad79d768cc420566385467f82 (diff)
downloadchords-32c3d85afe767ceaefb26f0cadd962793d3de642.tar.gz
chords-32c3d85afe767ceaefb26f0cadd962793d3de642.zip
diatonic → scale
-rw-r--r--index.html4
-rw-r--r--key-picker.mjs6
2 files changed, 5 insertions, 5 deletions
diff --git a/index.html b/index.html
index fc12e45..b4b345c 100644
--- a/index.html
+++ b/index.html
@@ -113,8 +113,8 @@
<option value='G'>G</option>
<option value='G♯'>G♯</option>
</select>
- <label for='diatonic'>diatonic:</label>
- <select id='diatonic' name='diatonic'>
+ <label for='scale'>scale:</label>
+ <select id='scale' name='scale'>
<option value='major' selected>major</option>
<option value='minor'>minor</option>
</select>
diff --git a/key-picker.mjs b/key-picker.mjs
index fc6b4ed..0a9068b 100644
--- a/key-picker.mjs
+++ b/key-picker.mjs
@@ -1,7 +1,7 @@
import { MajorScale, MinorScale, chromaticScale } from "./scale.mjs";
-function scaleFrom(tonic, diatonic) {
- switch (diatonic) {
+function scaleFrom(tonic, scale) {
+ switch (scale) {
case 'major':
return MajorScale(tonic);
case 'minor':
@@ -13,7 +13,7 @@ function scaleFrom(tonic, diatonic) {
function formChanged(form) {
const formData = new FormData(form);
- const scale = scaleFrom(formData.get('tonic'), formData.get('diatonic'));
+ const scale = scaleFrom(formData.get('tonic'), formData.get('scale'));
['tonic', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh'].forEach((c, i) => {
Array.from(form.getElementsByClassName(c)).forEach(elt => elt.innerText = scale[i]);
});