-
Notifications
You must be signed in to change notification settings - Fork 8
/
performance.html
130 lines (123 loc) · 4.56 KB
/
performance.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!-- Copyright 2018 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
============================================================================-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Performance</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">
<h2>Settings</h2>
<h3>Piano roll</h3>
<div class="setting" id="noteWidth">
<label>Time scale</label>
<input id="timeScaleInput" type="number" value="1" 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>Note margin (px)</label>
<input id="noteMarginInput" type="number" value="0" min="0" max="200" step="1">
</div>
<div class="setting">
<label>Hide grey lines</label>
<input id="greyLinesInput" type="checkbox" checked>
</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>
<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: Piano Performance</h1>
<p>
<label class="button">+ Load file
<input id="loadBtn" type="file">
</label>
<button id="loadOtherPerf" hidden>Load secondary file</button>
<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>
<svg id="velocities"></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>