-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc.html
90 lines (89 loc) · 4.31 KB
/
calc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body onload="calc()">
<a href="index.html">トップページに戻る</a>
<hr>
<div style="font-size: 120%">
<h3><a href="https://twitter.com/OrangeTheKeyqa/status/1142429621285056519">変拍子兄さん</a>流</h3>
<select id="pitch" onblur="calc()" onfocus="calc()" oninput="calc()" onchange="calc()">
<option>ド</option>
<option>デ</option>
<option>ネ</option>
<option>ゲ</option>
<option>レ</option>
<option>ル</option>
<option>リ</option>
<option>ム</option>
<option>ミ</option>
<option>メ</option>
<option>ファ</option>
<option>ヴァ</option>
<option>フィ</option>
<option>ショ</option>
<option>ソ</option>
<option>ゴ</option>
<option>ゾ</option>
<option>マ</option>
<option>ラ</option>
<option>ワ</option>
<option>セ</option>
<option>ゼ</option>
<option>シ</option>
<option>ス</option>
</select> を
<select id="interval" onblur="calc()" onfocus="calc()" oninput="calc()" onchange="calc()">
<option>perfect unison</option>
<option>major unison / infra second</option>
<option>augmented unison / minor second</option>
<option>neutral second</option>
<option>major second</option>
<option>ultra second / infra third</option>
<option>minor third</option>
<option>neutral third</option>
<option>major third / diminished fourth</option>
<option>ultra third / minor fourth</option>
<option>perfect fourth</option>
<option>major fourth / minor tritone</option>
<option>augmented fourth / Tritone / diminished fifth</option>
<option>major tritone / minor fifth</option>
<option>perfect fifth</option>
<option>major fifth / minor tetratone / infra sixth</option>
<option>augmented fifth / Tetratone / minor sixth</option>
<option>major tetratone / neutral sixth</option>
<option>major sixth</option>
<option>ultra sixth / infra seventh</option>
<option>minor seventh</option>
<option>neutral seventh</option>
<option>major seventh / diminished octave</option>
<option>ultra seventh / minor octave</option>
<option>octave</option>
<option>major octave</option>
<option>augmented octave</option>
</select>
<select id="direction" onblur="calc()" onfocus="calc()" oninput="calc()" onchange="calc()">
<option>上げる</option>
<option>下げる</option>
</select>
と <span id="res"></span>
</div>
<hr>
<a href="index.html">トップページに戻る</a>
<script>
const pitch2 = ["シ# / ド", "ド‡", "ド# / レb", "レd", "レ", "レ‡", "レ# / ミb", "ミd", "ミ / ファb", "ミ‡ / ファd", "ミ# / ファ", "ファ‡", "ファ# / ソb", "ソd", "ソ", "ソ‡", "ソ# / ラb", "ラd", "ラ", "ラ‡", "ラ# / シb", "シd", "シ / ドb", "シ‡ / ドd"];
const pitch1 = ["ド", "デ", "ネ", "ゲ", "レ", "ル",
"リ", "ム", "ミ", "メ", "ファ", "ヴァ",
"フィ", "ショ", "ソ", "ゴ", "ゾ", "マ",
"ラ", "ワ", "セ", "ゼ", "シ", "ス"];
function calc() {
const p = (calcpitch() + 48) % 24;
document.getElementById("res").textContent = pitch1[p] + " (" + pitch2[p] + ")";
}
function calcpitch() {
return document.getElementById("pitch").options.selectedIndex + document.getElementById("interval").options.selectedIndex * [1, -1][document.getElementById("direction").options.selectedIndex];
}
</script>
</body>
</html>