Skip to content

Commit

Permalink
Fixed offset in the warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jazz-soft committed Oct 7, 2021
1 parent ffcbf96 commit 49eae9d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bower.json
Expand Up @@ -26,6 +26,6 @@
"Gruntfile.js"
],
"dependencies": {
"jzz": "^1.4.1"
"jzz": "^1.4.3"
}
}
8 changes: 4 additions & 4 deletions javascript/JZZ.midi.SMF.js
Expand Up @@ -14,7 +14,7 @@
/* istanbul ignore next */
if (JZZ.MIDI.SMF) return;

var _ver = '1.6.3';
var _ver = '1.6.4';

var _now = JZZ.lib.now;
function _error(s) { throw new Error(s); }
Expand Down Expand Up @@ -564,7 +564,7 @@
x = (x + '\x00\x00').substr(0, m);
}
for (var i = 0; i < m; i++) if (x.charCodeAt(i) > 127) {
trk._complain(off, 'Bad MIDI value', x.charCodeAt(i), t);
trk._complain(off + i, 'Bad MIDI value set to 0', x.charCodeAt(i), t);
x = x.substr(0, i) + '\x00' + x.substr(i + 1);
}
return x;
Expand Down Expand Up @@ -634,10 +634,10 @@
p += 1;
m = _msglen(w.charCodeAt(0));
if (w.charCodeAt(0) > 0xf0) this._complain(offset, 'Unexpected MIDI message', w.charCodeAt(0).toString(16), t);
this.push(new Event(t, w, _validate_msg_data(this, s, p, m, t, offset), offset));
this.push(new Event(t, w, _validate_msg_data(this, s, p, m, t, offset + 1), offset));
p += m;
}
else if (w.charCodeAt(0) & 0x80) {
else if (w.charCodeAt(0) & 0x80) { // running status
m = _msglen(w.charCodeAt(0));
if (w.charCodeAt(0) > 0xf0) this._complain(offset, 'Unexpected MIDI message', w.charCodeAt(0).toString(16), t);
this.push(new Event(t, w, _validate_msg_data(this, s, p, m, t, offset), offset));
Expand Down

0 comments on commit 49eae9d

Please sign in to comment.