-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.html
49 lines (38 loc) · 1.3 KB
/
example.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
<!DOCTYPE html>
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="js/play.js" type="text/javascript"></script>
<script src="js/MIDI.min.js" type="text/javascript"></script>
<script src="js/tabla-ogg.js"></script>
<script src="js/tabla-mp3.js"></script>
</head>
<body>
<h1>Composition</h1>
<textarea id="composition" cols="120" rows="20">
Dha1[5.0]+++++| Ti| - | Dha1[2] | Ti | Ta | Dha1 | Dha2 | Ti | Ta | Dha1 | Ge | Thun | Na | Ke | Na |
Ta+++++ | Ti | Ta | Ta | Ti | Ta | Ta | Ta2 | Ti | Ta | Dha1 | Ge | Dhin | Na | Ge | Na
</textarea>
<br />
<input type="button" onclick="readComposition()" value="Play">
<input type="button" onclick="stopAllBeats()" value="Stop">
<p>Compositions are written in the <a href="http://www.taalmala.com/help.shtml">TaalMala</a> notation.</p>
<script type="text/javascript">
var VOLUME = 120;
var CHANNEL = 2;
window.onload = function () {
MIDI.loadPlugin({
instruments: "synth_drum",
onsuccess: function() {
MIDI.programChange(CHANNEL, 118);
readComposition()
}
});
};
function readComposition() {
var script = document.getElementById("composition").value;
playComposition(script, 360)
}
</script>
</body>
</html>