From 48a0ff13aac3323ed1810110db3efdc5d014efd0 Mon Sep 17 00:00:00 2001 From: Wiwi Kuan Date: Sat, 13 Apr 2019 12:53:53 +0800 Subject: [PATCH] Update circleOfFifths.js --- circleOfFifths.js | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/circleOfFifths.js b/circleOfFifths.js index 85d458f..e10b6e0 100644 --- a/circleOfFifths.js +++ b/circleOfFifths.js @@ -3,8 +3,8 @@ let outC1; let outC2; let outCH; let outCT; -let outCSP; // 分隔 -let outText = ["沒有升降", "1 個 #", "2 個 #", "3 個 #", "4 個 #", "7 個 b / 5 個 #", "6 個 b / 6 個 #", "5 個 b / 7 個 #", "4 個 b", "3 個 b", "2 個 b", "1 個 b"] +let outCSP; // 分隔 +let outText = ["沒有升降", "1 個 #", "2 個 #", "3 個 #", "4 個 #", "7 個 b / 5 個 #", "6 個 b / 6 個 #", "5 個 b / 7 個 #", "4 個 b", "3 個 b", "2 個 b", "1 個 b"] let outTextSize = 15; let majorRatio = 0.74; @@ -22,18 +22,18 @@ let minorText = ["Am", "Em", "Bm", "F#m", "C#m", "Abm/G#m", "Ebm/D#m", "Bbm/A#m" let minorTextSize = 17; let detailText1 = [ - "C 大調 ─ A 小調", - "G 大調 ─ E 小調", - "D 大調 ─ B 小調", - "A 大調 ─ F# 小調", - "E 大調 ─ C# 小調", - "Cb 大調 ─ Ab 小調 / B 大調 ─ G# 小調", - "Gb 大調 ─ Eb 小調 / F# 大調 ─ D# 小調", - "Db 大調 ─ Bb 小調 / C# 大調 ─ A# 小調", - "Ab 大調 ─ F 小調", - "Eb 大調 ─ C 小調", - "Bb 大調 ─ G 小調", - "F 大調 ─ D 小調" + "C 大調 ─ A 小調", + "G 大調 ─ E 小調", + "D 大調 ─ B 小調", + "A 大調 ─ F# 小調", + "E 大調 ─ C# 小調", + "Cb 大調 ─ Ab 小調 / B 大調 ─ G# 小調", + "Gb 大調 ─ Eb 小調 / F# 大調 ─ D# 小調", + "Db 大調 ─ Bb 小調 / C# 大調 ─ A# 小調", + "Ab 大調 ─ F 小調", + "Eb 大調 ─ C 小調", + "Bb 大調 ─ G 小調", + "F 大調 ─ D 小調" ] let detailTextSize = 22; @@ -86,7 +86,7 @@ function setup() { minorTextSize = width * 0.02125; detailTextSize = width * 0.0275; - lockButton = createButton('[已鎖定]'); + lockButton = createButton('[已鎖定]'); lockButton.position(19, 19); lockButton.mousePressed(toggleLocked); @@ -95,10 +95,10 @@ function setup() { function toggleLocked() { if (locked) { - lockButton.html("鎖定"); + lockButton.html("鎖定"); locked = false; } else { - lockButton.html("[已鎖定]"); + lockButton.html("[已鎖定]"); locked = true; } } @@ -118,10 +118,8 @@ function drawOuter(ang) { strokeWeight(width / 600); for (i = 0; i < 12; i++) { fill((i % 2 == 0) ? outC1 : outC2); - if (i == highlighted()) { fill(outCH); - } let j = i + ang; arc(0, 0, width * outRatio, height * outRatio, TAU * (j / 12), TAU * ((j + 1) / 12) - 0.000001, PIE); @@ -133,7 +131,7 @@ function drawOuter(ang) { function drawOuterText(ang) { for (i = 0; i < 12; i++) { - let j = i + ang + 3.5; // 把第一個字畫到右方 + let j = i + ang + 3.5; // 把第一個字畫到右方 push(); rotate(TAU * (j / 12)); textAlign(CENTER); @@ -288,7 +286,7 @@ function drawSigNumber(s, f) { default: fill(80); textSize(width / 60); - text("♮", 0, height * 0.14); + text("â™®", 0, height * 0.14); fill(60); } rect((0 + sp * i) * width, height * 0.12, height * w, height * h); @@ -297,7 +295,7 @@ function drawSigNumber(s, f) { } textSize(width / 60); fill(90); - text(`(${-f} 個降記號 / ${s} 個升記號)`, 0, height * 0.16); + text(`(${-f} 個降記號 / ${s} 個升記號)`, 0, height * 0.16); } function drawKeySig(sig, x, y) { @@ -343,7 +341,6 @@ function mouseAngle(ang) { let h = v.heading(); // -PI ~ PI let i = map(h, -PI, PI, 6, 18); mouseDir = (i > 12) ? i - 12 : i; - // dbText = `${(mouseX-width/2)/width}, ${(mouseY-height/2)/height}`; } @@ -368,7 +365,7 @@ function draw() { background(95); translate(width / 2, height / 2); mouseAngle(angle); - rotateGlobal() + rotateGlobal(); highlighted(); drawOuter(angle); drawOuterText(angle);