-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.html
More file actions
54 lines (50 loc) · 1.5 KB
/
Copy pathdebug.html
File metadata and controls
54 lines (50 loc) · 1.5 KB
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> sf2.js test </title>
</head>
<body bgcolor="#C0FFE0">
<h1></h1>
<div> <button id="sfback"> </button> <span id="sftitle"> </span> </div>
<table>
<tr>
<td rowspan=2> <table id="sftable" border=1> </table> </td>
<td>
<canvas id="wave" width=600 height=200 background="black"> </canvas>
</td>
</tr>
<tr> <td>
<canvas id="waveloop" width=600 height=200 background="black"> </canvas>
</td>
</tr>
</table>
<script type="text/javascript" src="sf2.js"> </script>
<script type="text/javascript" src="debug.js"> </script>
<script type="text/javascript">
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", function() {
var url = location.search.substr(1).split("&")[0];
url = "sample/"+(url?url:"emuaps_8mb.sf2");
//
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState > 3) {
if (xhr.status == 200) {
console.debug("sound font loading done:"+xhr.response.byteLength);
var sf = new SoundFont2();
sf.input(xhr.response);
viewBanksPresets(sf);
}
}
};
xhr.open('GET', url);
xhr.overrideMimeType('text/plain; charset=x-user-defined');
xhr.responseType = 'arraybuffer';
xhr.send(null);
})
}
</script>
<hr>
<address></address>
</body> </html>