-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.html
70 lines (61 loc) · 3.13 KB
/
test.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
<!DOCTYPE html>
<html lang=en>
<head>
<title>JZZ.gui.Karaoke Test</title>
<script src="node_modules/jzz/javascript/JZZ.js"></script>
<script src="node_modules/jzz-synth-tiny/javascript/JZZ.synth.Tiny.js"></script>
<script src="node_modules/jzz-midi-smf/javascript/JZZ.midi.SMF.js"></script>
<script src="node_modules/jzz-gui-player/javascript/JZZ.gui.Player.js"></script>
<script src="javascript/JZZ.gui.Karaoke.js"></script>
<style type="text/css">
.karaoke { background-color: #eef; padding: .5em; }
.karaoke .t { font-size: 110%; font-weight: bold; }
.karaoke p { margin: 0; padding: .5em; }
.karaoke p.current { background-color: #ffe; }
.karaoke div.current { text-decoration: underline; }
.karaoke span.current { color: #f00; }
.karaoke span.past { color: #d0c; }
.karaoke .k, .karaoke .v, .karaoke .i, .karaoke .l, .karaoke .w { font-size: 50%; color: #888; }
</style>
</head>
<body>
<h1>JZZ.gui.Karaoke Test</h1>
<p id=player>Please enable JavaScript!</p>
<p id=note style='display:none;'>
<em>NOTE:</em> For better sound quality, you may want to install the
<a target=_blank href=http://jazz-soft.net>Jazz-Plugin</a> and browser extension from
<a target=_blank href=https://chrome.google.com/webstore/detail/jazz-midi/jhdoobfdaejmldnpihidjemjcbpfmbkm>Chrome Web Store</a>
or <a target=_blank href=https://addons.mozilla.org/en-US/firefox/addon/jazz-midi>Mozilla Add-ons</a>
or <a target=_blank href=https://apps.apple.com/us/app/jazz-midi/id1506447231>Apple App Store</a>.
</p>
<pre id=log></pre>
<script><!--
var log = document.getElementById('log');
function report(s) { return function() { log.innerHTML = s; }; }
document.getElementById('player').innerHTML = 'Please run <tt style="background-color:#bbf;"><b>npm install</b></tt> to enable this test.';
JZZ.synth.Tiny.register('Web Audio');
document.getElementById('player').innerHTML = '';
document.getElementById('note').style.display = 'block';
JZZ().or(report('Cannot start MIDI engine!')).openMidiOut().or(report('Cannot open MIDI Out!'));
var player = new JZZ.gui.Player({ at: 'player', file: true });
var karaoke = new JZZ.gui.Karaoke('karaoke');
player.connect(karaoke);
player.onEnd = function() { karaoke.reset(); };
player.onStop = function() { karaoke.reset(); };
player.onLoad = function(smf) { karaoke.load(smf); };
player.onJump = function(t) { karaoke.jump(t); };
var data='\
TVRoZAAAAAYAAQADAGRNVHJrAAAAGgD/AwtMaXR0bGUgTGFtZQD/UQMKLCsA/y8ATVRyawAAAPMA/wMG\
THlyaWNzAP8BGEBUTWFyeSBXYXMgQSBMaXR0bGUgTGFtZWT/AQNcTWFL/wEDcnkgGf8BBHdhcyAy/wEC\
YSAy/wEDbGl0Mv8BBHRsZSAy/wEFbGFtZSxk/wEEL0xpdDL/AQR0bGUgMv8BBWxhbWUsZP8BBC9MaXQy\
/wEEdGxlIDL/AQVsYW1lLGT/AQMvTWFL/wEDcnkgGf8BBHdhcyAy/wECYSAy/wEDbGl0Mv8BBHRsZSAy\
/wEFbGFtZSwy/wEDL0EgMv8BA2xpdDL/AQR0bGUgMv8BBWxhbWUgMv8BBHdhcyAy/wEEc2hlIQD/LwBN\
VHJrAAAA8gD/AwVNdXNpYwDAC2SQQH9LgEBAAJA+fxmAPkAAkDx/MoA8QACQPn8ygD5AAJBAfzKAQEAA\
kEB/MoBAQACQQH9agEBACpA+fzKAPkAAkD5/MoA+QACQPn9agD5ACpBAfzKAQEAAkEN/MoBDQACQQ39a\
gENACpBAf0uAQEAAkD5/GYA+QACQPH8ygDxAAJA+fzKAPkAAkEB/MoBAQACQQH8ygEBAAJBAfzKAQEAZ\
kEB/GYBAQACQPn8ygD5AAJA+fzKAPkAAkEB/MoBAQACQPn8ygD5AAJA8f2RAZABDZABIf1qAPEAAQEAA\
Q0AASEAK/y8A';
player.load(new JZZ.MIDI.SMF(JZZ.lib.fromBase64(data)));
--></script>
</body>
</html>