-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbach.html
112 lines (105 loc) · 3.61 KB
/
bach.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bach</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./style.css">
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Mono:400|Open+Sans" rel="stylesheet">
<script src="./script.js" type="module" defer></script>
<script src="https://cdn.jsdelivr.net/npm/@magenta/[email protected]"></script>
</head>
<body>
<div class="wrapper">
<div class="settings">
<h3>Piano roll</h3>
<div class="setting" id="noteWidth">
<label>Note width (px)</label>
<input id="noteWidthInput" type="number" value="50" min="0" max="200" step="1">
</div>
<div class="setting">
<label>Note height (px)</label>
<input id="noteHeightInput" type="number" value="8" min="0" max="200" step="1">
</div>
<div class="setting">
<label>Animate speed (ms)</label>
<input id="playSpeedInput" type="number" value="500" min="0" max="5000" step="50">
</div>
<div class="setting">
<label>Tempo</label>
<input id="tempoInput" type="number" value="120" min="0" max="200" step="1">
</div>
<h3>Visualization</h3>
<div class="setting">
<label>Circle paths</label>
<input id="circleInput" type="checkbox" checked>
</div>
<div class="setting">
<label>No paths</label>
<input id="noPathsInput" type="checkbox">
</div>
<div class="setting">
<label>Single colour only</label>
<input id="weirdModeInput" type="checkbox">
</div>
<div class="setting">
<label>Highlight whole step</label>
<input id="highlightStepInput" type="checkbox">
</div>
<h3>Attention weights</h3>
<div class="setting">
<label>Arrow cutoff weight</label>
<input id="cutoffInput" type="number" value="0.5" min="0" max="1" step="0.01">
</div>
<div class="setting">
<label>Epsilon</label>
<input id="epsilonInput" type="number" value="0.00001" min="0" max="1" step="0.0001">
</div>
<div class="setting">
<label>Top weights only</label>
<input id="topOnlyInput" type="checkbox">
</div>
<div class="setting">
<label>Top #</label>
<input id="topAmountInput" type="number" value="10" min="0" max="100" step="1">
</div>
<h3>Current state</h3>
<div class="setting">
<label>Step</label>
<span id="stepText"></span>
</div>
<div class="setting">
<label>Layer</label>
<select id="layers"></select>
</div>
<div class="setting">
<label>Head</label>
<select id="heads"></select>
</div>
<div class="setting">
<div id="headColors"></div>
</div>
</div>
<div class="main">
<h1><button id="drawerBtn"><</button>Relative attention: Bach</h1>
<p>
<label class="button">+ Load file
<input id="loadBtn" type="file">
</label>
<button id="resetBtn">Reset</button>
<button id="animateBtn">Animate</button>
<button id="playBtn">Play Audio</button>
<button id="downloadBtn">Download MIDI</button>
<span id="filenameSpan" hidden></span>
</p>
<h3 id="loading">Loading...</h3>
<br>
<div id="output" hidden>
<svg id="music"></svg>
</div>
<svg id="heatmap" hidden></svg>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js" defer></script>
</body>
</html>