-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
216 lines (203 loc) · 10.8 KB
/
index.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MusicXML</title>
<link rel="shortcut icon" href="assets/images/icon.png">
<link rel="stylesheet" href="assets/css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="assets/css/bootstrap-slider.min.css"/>
<link rel="stylesheet" href="assets/css/demo.css"/>
<link rel="stylesheet" href="assets/css/style.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
<script src="assets/js/jquery-2.2.4.min.js"></script>
<script src="assets/js/abc2svg-1.js"></script>
<script src="assets/js/xml2abc.js"></script>
<script src="assets/js/xmlplay.js"></script>
<script src="assets/js/bootstrap-slider.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/howler.js"></script>
<script src="assets/js/velocity.min.js"></script>
<script src="assets/js/metronome.js"></script>
<style>
div.dropdown.navbar-right {
padding-top: 8px;
padding-left: 10px;
}
div.dropdown.navbar-right ul.dropdown-menu li {
margin-bottom: 0
}
div.dropdown.navbar-right ul.dropdown-menu li a {
margin-bottom: 0
}
</style>
<script>
instrument_arr = [];
var instrument_play_ary = [];
window.inst_num = [], window.MIDInum = [];
function resetInstrumentArr() {
$("div.dropdown.navbar-right").addClass("hidden");
instrument_arr = [];
instrument_play_ary = [];
$("div.dropdown.navbar-right ul.dropdown-menu li").each(function(index) {
if(index > 0) {
$(this).remove();
}
});
}
function initInstrumentArr() {
$("div.dropdown.navbar-right").removeClass("hidden");
$("div.dropdown.navbar-right button.dropdown-toggle").html('All Instrument <span class="caret"></span>');
}
function addInstrumentArr(name, id) {
instrument_arr.push(name);
instrument_play_ary.push(parseInt(id.substr(1)) - 1);
$("div.dropdown.navbar-right ul.dropdown-menu").append('<li><a href="#">' + name + '</a></li>');
var instrument_name = (name.replace(/\s/g, "_")).toLowerCase();
window.inst_num.push(inst_tb.indexOf(instrument_name));
}
function setOnlyInstrument() {
var instrument = $(this).find("a").text();
var instrument_index = instrument_arr.indexOf(instrument);
$("div.dropdown.navbar-right button.dropdown-toggle").html(instrument + ' <span class="caret"></span>');
var i = 0;
if(instrument_index == -1){
for(i=0; i<midiPan.length; i++) {
midiVol[i] = 100;
}
} else {
for(i=0; i<midiPan.length; i++) {
if(instrument_index < instrument_play_ary.length - 1) {
if(i >= instrument_play_ary[instrument_index] && i < instrument_play_ary[instrument_index + 1])
midiVol[i] = 100;
else
midiVol[i] = 0;
} else {
if(i >= instrument_play_ary[instrument_index])
midiVol[i] = 100;
else
midiVol[i] = 0;
}
}
}
}
$(document).on("click", "div.dropdown.navbar-right ul.dropdown-menu li", setOnlyInstrument);
</script>
</head>
<body>
<nav class="navbar navbar-default navbar-custom" style="padding: 0px 50px;">
<div class="container" style="margin: 0px; display:inline">
<div class="navbar-header" style="display: contents;">
<!-- <img alt="alphaTab" src="assets/images/symbol.png" style="width: 35px; height: 50px; float: left;"> -->
<div class="navbar-brand logo-txt" href="#" style="display: flex;">
MusicXML Player
</div>
<div class="input-group navbar-brand" style="width: 300px; padding: 8px 15px">
<span class="input-group-btn">
<span class="btn btn-primary btn-file">
Browse… <input type="file" single id="fknp">
</span>
</span>
<input type="text" class="form-control" readonly>
</div>
<ul class="nav navbar-nav">
<li>
<button id="play" class="btn btn-link navbar-btn">
<i class="glyphicon glyphicon-play"></i>
<i class="glyphicon glyphicon-pause"></i>
</button>
</li>
<li>
<button id="stop" class="btn btn-link navbar-btn">
<i class="glyphicon glyphicon-stop"></i>
</button>
</li>
<li>
<span style="color:white">Tempo</span>
<input id="playbackSpeed" type="text"/>
</li>
<!--<li><a href="#" id="looping" class="glyphicon glyphicon-refresh"></a></li>-->
<li>
<!-- <a href="#" id="metronome" class="glyphicon glyphicon-edit" data-toggle="tooltip"
data-placement="bottom" title="Metronome"></a> -->
</li>
<li>
<!-- <input id="playVolume" type="text"/> -->
</li>
<li>
<div class="radio">
<label style="color:white"><input type="radio" name="optradioPosition" value="0" checked>Vertical</label>
</div>
<div class="radio">
<label style="color:white"><input type="radio" name="optradioPosition" value="1">Horizontal</label>
</div>
</li>
<li id="notesgap" style="display:none; margin-top: 10px;">
<span style="color:white">Zoom <%></span>
<input id="notesgapvalue" type="number" value="1" />
</li>
<li id="notesgap2" style="margin-top: 10px;">
<span style="color:white">Zoom <%></span>
<input id="notesgapvalue2" type="number" value="1" />
</li>
</ul>
<div class="dropdown navbar-right hidden" style="display: none;">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false" id="inst_name">
All Instrument
<span class="caret"></span>
</button>
<ul class="dropdown-menu" style="display: none;">
<li><a href="#">All Instrument</a></li>
</ul>
</div>
</div>
</div>
</nav>
<span id="btns">
<div id="mbar" tabindex="1" style="background: rgb(170, 170, 170); display:none;">Menu</div>
<form id="menu" style="display: block;">
<label><span id="kwart"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="mtrsvg"
viewBox="0 0 220.31308 310.88881" width="20px">
<g transform="translate(-168.05564,-173.54485)" id="g3537">
<g id="layer1">
<path id="path9868" d="m 245.73622,175.45935 -76.37696,284.7106 217.71005,0 -75.66317,-285.61445 z"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"></path>
<path id="path9872" d="m 187.81381,391.35577 181.41126,0"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"></path>
<path id="path9880" d="M 378.50585,249.287 290.81011,391.32898"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"></path>
<rect transform="matrix(0.84278384,0.53825217,-0.52161495,0.85318102,0,0)" y="20.876596" x="442.99142"
height="25.758644" width="19.224855" id="rect9882"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:8;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"></rect>
<path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:8px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 277.14286,223.79078 0,167.85714" id="path9874"></path>
<path id="rect10855" d="m 194.64285,460.21936 28.57143,0 -6,23.21429 -16.57143,0 z"
style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:8;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"></path>
<path style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:8;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 328.64285,460.21936 28.57143,0 -6,23.21429 -16.57143,0 z" id="path10858"></path>
</g>
</g>
</svg></span><input type="number" min="20" max="300" id="tempo"></label>
<label id="drplbl"><span>Use Dropbox:</span><input id="drpuse" type="checkbox" tabindex="3"></label>
<label><span>Full Screen</span><input id="fscr" type="checkbox" style="display:none;"></label>
<label id="savlbl"><span>Save SVG</span><input type="button" id="save" value="save svg"></label>
<label id="verlab" class="rflt"><span>Version:</span>96</label>
<label><span>Help</span></label>
</form>
</span>
<div id="rollijn" class="dashed" title="drag to reposition the focussed staff"></div>
<div id="comp" class="dlog" style="display: block;"></div>
<pre id="wait" class="dlog" style="display: none;">Loading, please wait ...</pre>
<div id="saveDiv" style="display:none;"></div>
<svg class="dlog" id="playbk" width="100" height="100" viewBox="0 0 20 20" style="z-index: 8; display: none;"
xmlns="http://www.w3.org/2000/svg">
<path d="m8,14.5l6,-4.5l-6,-4.5l0,9l0,0zm2,-14.5c-5.5,0 -10,4.5 -10,10c0,5.5 4.5,10 10,10c5.5,0 10,-4.5 10,-10c0,-5.5 -4.5,-10 -10,-10l0,0zm0,18c-4.4,0 -8,-3.6 -8,-8c0,-4.4 3.6,-8 8,-8c4.4,0 8,3.6 8,8c0,4.4 -3.6,8 -8,8l0,0z"></path>
</svg>
<div id="notation2" style="scroll-behavior: auto;">
<div class="rat" id="notation">
</div>
</div>
<pre class="rat" id="err" style="display:none;">
</pre>
<script type="text/javascript" src="assets/js/control.js"></script>
</body>
</html>