-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.js
More file actions
22 lines (19 loc) · 622 Bytes
/
Copy pathtest.js
File metadata and controls
22 lines (19 loc) · 622 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var JZZ = require('jzz');
require('jzz-midi-smf')(JZZ);
require('.')(JZZ);
var file = process.argv[2];
if (typeof file == 'undefined') file = 'test.mid';
var data = require('fs').readFileSync(file, 'binary');
var smf = new JZZ.MIDI.SMF(data);
var kar = new JZZ.gui.Karaoke();
kar.load(smf);
var player = smf.player();
player.connect(kar);
JZZ.lib.registerMidiOut('dummy', {
_info: function(name) { return { name: name }; },
_openOut: function(port) { port._resume(); }
});
JZZ().or('Cannot start MIDI engine!').openMidiOut().or('Cannot open MIDI Out!').and(function() {
player.connect(this);
player.play();
});