diff --git a/code2/test-text-message.js b/code2/test-text-message.js index 649ebc9..0ea4958 100644 --- a/code2/test-text-message.js +++ b/code2/test-text-message.js @@ -30,7 +30,7 @@ clip .umpCPerformerName(6, 6, 'Performer Name per channel') .tick(96) .umpAccPerformerName(7, 'Accompanying Performer Name per group') - .umpCAccPerformerName(7, 7, 'AccompanyingPerformer Name per channel') + .umpCAccPerformerName(7, 7, 'Accompanying Performer Name per channel') .tick(96) .umpRecordingDate(8, 'Recording Date per group') .umpCRecordingDate(8, 8, 'Recording Date per channel') diff --git a/index.js b/index.js index f5ec260..1569527 100644 --- a/index.js +++ b/index.js @@ -24,11 +24,25 @@ Warn.prototype.toString = function() { if (typeof this.data != 'undefined') a.push('(' + this.data + ')'); return a.join(' '); }; -function _tohex(x) { return (x < 16 ? '0' : '') + x.toString(16); } +function _hex(x) { return (x < 16 ? '0' : '') + x.toString(16); } RawClip.prototype = []; RawClip.prototype.send = function(msg) { this.push(JZZ.UMP(msg)); return this; }; -RawClip.prototype.annotate = function() {}; +RawClip.prototype.annotate = function() { + var i, ctxt; + ctxt = JZZ.Context(); + for (i = 0; i < this.length; i++) { + if (this[i].isStartClip()) break; + if (this[i].lbl) this[i].lbl = undefined; + ctxt._read(this[i]); + } + ctxt = JZZ.Context(); + for (; i < this.length; i++) { + if (this[i].lbl) this[i].lbl = undefined; + ctxt._read(this[i]); + } + return this; +}; RawClip.prototype.validate = function() { var i; var off = this._off || 0; @@ -77,7 +91,7 @@ RawClip.prototype.load = function(s) { len = [4, 4, 4, 8, 8, 16, 4, 4, 8, 8, 8, 12, 12, 16, 16, 16][t]; a = []; if (s.length < off + len) { - for (i = off; i < s.length; i++) a.push(_tohex(s.charCodeAt(i))); + for (i = off; i < s.length; i++) a.push(_hex(s.charCodeAt(i))); this._complain(off, 'Incomplete message', a.join(' ')); off += len; break; diff --git a/midi2/test-text-message.midi2 b/midi2/test-text-message.midi2 index 840328c..ee9836c 100644 Binary files a/midi2/test-text-message.midi2 and b/midi2/test-text-message.midi2 differ diff --git a/package.json b/package.json index ca1c708..cdd229c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "test-midi-files", - "version": "1.0.4", + "version": "1.0.5", "description": "A framework for producing test MIDI files", "main": "index.js", "scripts": { @@ -20,15 +20,15 @@ ], "author": "jazz-soft (https://jazz-soft.net)", "dependencies": { - "jzz": "^1.7.9", - "jzz-gui-player": "^1.7.0", + "jzz": "^1.8.1", + "jzz-gui-player": "^1.7.2", "jzz-midi-gear": "^1.3.2", "jzz-midi-gm": "^1.3.5", - "jzz-midi-smf": "^1.8.6", + "jzz-midi-smf": "^1.9.0", "jzz-synth-tiny": "^1.3.8" }, "devDependencies": { - "eslint": "^8.56.0", + "eslint": "^8.57.0", "grunt": "^1.6.1", "mocha": "^10.3.0", "nyc": "^15.1.0"