From 70cac8f25ffcc863582979c00f7b372c3eec8c95 Mon Sep 17 00:00:00 2001 From: Wiwi Kuan Date: Mon, 25 Nov 2024 09:58:18 +0800 Subject: [PATCH] Add files via upload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 三倍增六度 bug。 --- index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.html b/index.html index 7404ba6..2773ac3 100644 --- a/index.html +++ b/index.html @@ -113,10 +113,17 @@ }) .slice(0, 2); + // 把完全一度改成完全八度。 let result = Tonal.Interval.distance(firstTwoNotes[0], firstTwoNotes[1]); if (result == "1P") { result = "8P"; } + + // Tonal.js 在三倍增六度以上會輸出「-1」,硬改回「6」。 + if (result.startsWith('-1')) { + result = '6' + result.slice(2); + } + console.log(convertToChineseInterval(result)); let resultWithOctave = []; resultWithOctave[0] = firstTwoNotes[0] + "4";