summaryrefslogtreecommitdiffstats
path: root/scale.mjs
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-03-10 16:23:07 -0400
committerBrian Cully <bjc@spork.org>2025-03-10 16:23:52 -0400
commit7928e4a7d3311cc1325d413c53ff349e5ef816b5 (patch)
treeb44b0798efdae904ac12fe8a8d1609062e6c12b4 /scale.mjs
parente4270f343a54129ab505edddf92724d310224c9c (diff)
downloadchords-7928e4a7d3311cc1325d413c53ff349e5ef816b5.tar.gz
chords-7928e4a7d3311cc1325d413c53ff349e5ef816b5.zip
scale: calculate diatonic scales
Diffstat (limited to 'scale.mjs')
-rw-r--r--scale.mjs8
1 files changed, 8 insertions, 0 deletions
diff --git a/scale.mjs b/scale.mjs
index 9bec03b..d33a5c3 100644
--- a/scale.mjs
+++ b/scale.mjs
@@ -182,3 +182,11 @@ export function MinorScale(tonic) {
const intervals = [2, 1, 2, 2, 1, 2];
return new Scale(tonic, intervals);
}
+
+// well, a lot of them.
+export const allDiatonicScales = chromaticScale.flatMap(tonic => {
+ return [
+ MajorScale(tonic),
+ MinorScale(tonic)
+ ];
+})