aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/main.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/public/main.js b/public/main.js
index 46ce5e0..bfbc65a 100644
--- a/public/main.js
+++ b/public/main.js
@@ -30,6 +30,15 @@ function getShift(t1, t2) {
}
function applyShift(tonalities, t1, s) {
+ const xs = t1.split('/')
+ if (xs.length > 1) {
+ return `${applyShiftChord(tonalities, xs[0], s)}/${applyShiftChord(tonalities, xs[1], s)}`
+ } else {
+ return applyShiftChord(tonalities, t1, s)
+ }
+}
+
+function applyShiftChord(tonalities, t1, s) {
let root = getRoot(t1)
const mode = t1.substring(root.length)
const index = tonalities_b.indexOf(root) > -1 ? tonalities_b.indexOf(root) : tonalities_s.indexOf(root)