-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·181 lines (169 loc) · 6.17 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title> Music Plasticity </title>
<meta name="description" content="Computer Aided Composition | Experimental Music Composition | MusicXML Processing">
<script src="js/xmlbuilder2.min.js" charset="utf-8"></script>
<script src="js/jszip.min.js"> </script>
<script src="js/verovio-toolkit.js" type="text/javascript" ></script>
<!-- midi-player -->
<script src="js/midi-player/wildwebmidi.js" type="text/javascript"></script>
<script src="js/midi-player/midiplayer_no_jquery.js" type="text/javascript"></script>
<!-- Ayk's xml- decoder & processor & encoder -->
<script src="js/decode_process_encode.js" type="text/javascript"></script>
<link rel="stylesheet" href="style.css">
<!-- ux controller etc -->
<script src="js/ux/nouislider/nouislider.min.js" charset="utf-8" type="text/javascript"></script>
<script src="js/ux/env+slider.js" charset="utf-8" defer></script>
<!-- <script src="js/ux/utilities.js" defer></script> -->
<link rel="stylesheet" href="js/ux/nouislider/nouislider.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- top navbar -->
<div id="navbar" class="navbar navbar-default navbar-with-sidebar">
<label for="file" style="color: brown;">Upload your xml file here >:</label>
<input type="file" id="file">
<button id="play-button" onclick="play_midi();" class="btn" type="button"> Play </button>
<button id="stop-button" onclick="stop_midi();" class="btn" type="button"> Stop </button>
<a href="#" id="xml_file_out" download="plastic_music.musicxml"> --> click to download .musicxml file <-- </a>
<!-- button, style fixed on the right side -->
<a href="README.html" id="about_button" target="_blank">
<button> A b o u t </button>
</a>
<br>
<button id="reset-button" onclick="reset()" class="btn" type="button"> Reset </button>
<form id="quant_form" action="index.html" method="post" style="float: right;">
<label for="quant">Quantization to:</label>
<select name="quant" id="quant">
<option value="0.125">thirty-second</option>
<option value="0.25" selected>sixteenth</option>
<option value="0.5">eighth</option>
</select>
</form>
</div>
<!-- //that contains sliders and envelope canvas ux -->
<div id="dynamic_gui">
<div id="dynamic_gui_x">
<label for="X_slider"> change time </label>
</div>
<div id="dynamic_gui_y"></div>
</div>
<!-- page-help style align left -->
<div id="page-help" style="float: right;">
<p><span id="l-arr">←</span> page <span id="l-arr">→</span> ...... <span>↑</span> zoom <span>↓</span> </p>
<!-- <p> {SPACE-BAR} to playback on-off</p> -->
</div>
<div id="settings">
<!-- <input type="checkbox" name="time_envelope" id="x_enved" onclick="createSliders()"> -->
<!-- Rectangular switch -->
<label class="switch">
<input type="checkbox" id="x_enved" onclick="update_dynamic_gui()" >
<!-- if checkbox is checked trigger create_canvas() and create_nr_input() else clear_canvas() -->
<span class="slider"></span>
</label>
<!-- <label for="x_enved"> Click for envelope rescaling / by default uniform rescaling </label> -->
<label for="x_enved"> uniform / gradual metre change </label>
<style>
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
</style>
</div>
<!-- //notation canvas -->
<div id="svg_panel" style="background-color: #fff;">
<div id="player" style="z-index: 20; position: absolute; display: none;"></div>
<div id="svg_output" />
<script type="text/javascript">
// document.getElementById("transformer").style.visibility="hidden";
// document.getElementById("xml_trigger").style.visibility="hidden";
document.getElementById("xml_file_out").style.visibility="hidden";
document.getElementById("play-button").style.visibility="hidden";
document.getElementById("stop-button").style.visibility="hidden";
document.getElementById("page-help").style.visibility="hidden";
document.getElementById("settings").style.visibility="hidden";
document.addEventListener('keydown', function(event) {
if (event.key == " " && !isPlaying) {
play_midi();
} else {
isPlaying = false;
stop_midi();
}
});
document.addEventListener('keydown', function(event) {
if (event.key == 'ArrowRight') {
nextPage();
} else if (event.key == 'ArrowLeft') {
prevPage();
} else if (event.key == 'ArrowUp' || event.key == '=') {
zoomIn();
} else if (event.key == 'ArrowDown' || event.key == '-') {
zoomOut();
}
});
</script>
</div>
</body>
<script type="text/javascript">
var filee=document.getElementById("file");
filee.addEventListener('change', reset_variables);
filee.addEventListener('change', file2xmlParser);
// change the variable QUANT to the value of the selected option in the form
var quant_form=document.getElementById("quant_form");
quant_form.addEventListener('change', function() {
QUANT = document.getElementById("quant").value;
console.log("QUANT: " + QUANT);
});
</script>
<!-- <script src="js/ux/env+slider.js" charset="utf-8"></script> -->
<script src="js/verovio_handlers.js" charset="utf-8"></script>
<script type="text/javascript">
starter();
</script>
<!-- display footer at the very bottom of the window -->
<!-- <footer style="position: fixed; bottom: 0; width: 100%; height: 30px; background-color: #f1f1f1; text-align: center;">
<a href="https://www.aykutcaglayan.net/legal.html"> Impressum & Datenschutz </a>
</footer> -->
</html>