diff --git a/bower.json b/bower.json index e71efda..e1684db 100644 --- a/bower.json +++ b/bower.json @@ -26,6 +26,6 @@ "Gruntfile.js" ], "dependencies": { - "jzz": "^1.0.8" + "jzz": "^1.0.9" } } diff --git a/javascript/JZZ.midi.SMF.js b/javascript/JZZ.midi.SMF.js index 94ec406..7ef0cc6 100644 --- a/javascript/JZZ.midi.SMF.js +++ b/javascript/JZZ.midi.SMF.js @@ -12,7 +12,7 @@ if (JZZ.MIDI.SMF) return; - var _ver = '1.3.8'; + var _ver = '1.3.9'; var _now = JZZ.lib.now; function _error(s) { throw new Error(s); } diff --git a/minified/JZZ.midi.SMF.js b/minified/JZZ.midi.SMF.js index bf3f3bb..d326a13 100644 --- a/minified/JZZ.midi.SMF.js +++ b/minified/JZZ.midi.SMF.js @@ -1 +1 @@ -!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i:"function"==typeof define&&define.amd?define("JZZ.midi.SMF",["JZZ"],i):i(JZZ)}(0,function(p){if(!p.MIDI.SMF){var e="1.3.8",r=p.lib.now;a.version=function(){return e},((a.prototype=[]).constructor=a).prototype.copy=function(){var t=new a;t.type=this.type,t.ppqn=this.ppqn,t.fps=this.fps,t.ppf=this.ppf,t.rmi=this.rmi,t.ntrk=this.ntrk;for(var i=0;it.length&&this._complain(i+t.length,"Incomplete data",n-t.length)},a.prototype.validate=function(){var t,i,r=[];if(this._warn)for(t=0;t=n[t].length||(a&&(o=n[t][h[t]].tt),a=!1,o>n[t][h[t]].tt&&(o=n[t][h[t]].tt))}if(s=o,a)break}}return r._type=this.type,r._tracks=n.length,r._timing(),r},(((a.Chunk=l).prototype=[]).constructor=l).prototype.copy=function(){return new l(this.type,this.data)},l.prototype.sub={MTrk:function(t,i,r){return new C(i,r)}},l.prototype.dump=function(){return this.type+s(this.data.length)+this.data},l.prototype.toString=function(){return this.type+": "+this.data.length+" bytes"},(((a.MTrk=C).prototype=[]).constructor=C).prototype.copy=function(){for(var t=new C,i=t.length=0;it)&&!(this[r].tt==t&&I(this[r])>e);r++);return this.splice(r,0,i),this},C.prototype.send=function(t){this._orig.add(this._tick,t)},C.prototype.tick=function(t){if(t!=parseInt(t)||t<0)throw RangeError("Bad tick value: "+t);if(!t)return this;var i=function(){};i.prototype=this._orig;var r=new i;return r._tick=this._tick+t,r},C.prototype.note=function(t,i,r,e){return this.noteOn(t,i,r),0this._pos);this._ptr++)this._filter(t);this._ptr>=this._data.length&&(this._loop&&-1!=this._loop&&this._loop--,this._loop?(this._ptr=0,this._p0=0,this._t0=i):this.stop(),this.onEnd()),"stop"==this.event&&(this.playing=!1,this.paused=!1,this._pos=0,this._ptr=0,this.sndOff(),this.event=void 0),"pause"==this.event&&(this.playing=!1,this.paused=!0,this._pos>=this._duration&&(this._pos=this._duration-1),this._p0=this._pos,this.sndOff(),this.event=void 0),this.playing&&p.lib.schedule(this._tick)},S.prototype.trim=function(){var t,i,r,e=[],n=0;for(t=i=0;t=this._duration&&(t=this._duration-1),this._goto(t)},S.prototype.jumpMS=function(t){isNaN(parseFloat(t))&&d("Not a number: "+t),t<0&&(t=0),t>=this._durationMS&&(t=this._durationMS-1),this._goto(this._ms2t(t))},S.prototype._t2ms=function(t){if(!t)return 0;var i;for(i=0;this._ttt[i].t=this._pos)break;81==t.ff&&this.ppqn&&(this._mul=1e3*this.ppqn/M(t.dd))}this.mul=this._mul*this._speed,this._t0=r(),this._p0=this._pos},S.prototype.tick2ms=function(t){return isNaN(parseFloat(t))&&d("Not a number: "+t),t<=0?0:t>=this._duration?this._durationMS:this._t2ms(t)},S.prototype.ms2tick=function(t){return isNaN(parseFloat(t))&&d("Not a number: "+t),t<=0?0:t>=this._durationMS?this._duration:this._ms2t(t)},p.MIDI.SMF=a}function d(t){throw new Error(t)}function o(t){var i="";return 2097151>21&127))),16383>14&127))),127>7&127))),i+=String.fromCharCode(127&t)}function n(t){return String.fromCharCode(t>>8)+String.fromCharCode(255&t)}function s(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}function h(t){return String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255)}function a(){var t,i,r=this instanceof a?this:r=new a,e=1,n=96;if(1==arguments.length){if(arguments[0]instanceof a)return arguments[0].copy();if("string"==typeof arguments[0]&&"0"!=arguments[0]&&"1"!=arguments[0]&&"2"!=arguments[0])return r.load(arguments[0]),r;e=parseInt(arguments[0])}else 2==arguments.length?(e=parseInt(arguments[0]),n=parseInt(arguments[1])):3==arguments.length?(e=parseInt(arguments[0]),t=parseInt(arguments[1]),i=parseInt(arguments[2])):arguments.length&&d("Invalid parameters");return(isNaN(e)||e<0||2r?u(t._off,"Invalid "+i+" meta event: data too long",t.toString(),t.tt):void 0}function v(t){var i;if(void 0!==t.ff){if(127>4;if(void 0!==(i={8:10,15:11,11:12,12:13,10:15,13:15,14:15}[r]))return i;if(9==r)return t[1]?14:10}return 18}function i(t,i,r){this._orig=t,this._chan=i,this._tick=r}function k(t,i,r,e){var n;if(255==i.charCodeAt(0))n=p.MIDI.smf(i.charCodeAt(1),r);else{for(var o=[i.charCodeAt(0)],s=0;s>21&127))),16383>14&127))),127>7&127))),i+=String.fromCharCode(127&t)}function n(t){return String.fromCharCode(t>>8)+String.fromCharCode(255&t)}function s(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)}function h(t){return String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255)}function a(){var t,i,r=this instanceof a?this:r=new a,e=1,n=96;if(1==arguments.length){if(arguments[0]instanceof a)return arguments[0].copy();if("string"==typeof arguments[0]&&"0"!=arguments[0]&&"1"!=arguments[0]&&"2"!=arguments[0])return r.load(arguments[0]),r;e=parseInt(arguments[0])}else 2==arguments.length?(e=parseInt(arguments[0]),n=parseInt(arguments[1])):3==arguments.length?(e=parseInt(arguments[0]),t=parseInt(arguments[1]),i=parseInt(arguments[2])):arguments.length&&d("Invalid parameters");return(isNaN(e)||e<0||2r?u(t._off,"Invalid "+i+" meta event: data too long",t.toString(),t.tt):void 0}function v(t){if(void 0!==(i={0:0,3:1,2:2,84:3,81:4,88:5,89:6,32:7,33:7,6:8,4:9,1:16,5:16,127:17,47:20}[t.ff]))return i;if(t.length){var i,r=t[0]>>4;if(void 0!==(i={8:10,15:11,11:12,12:13,10:15,13:15,14:15}[r]))return i;if(9==r)return t[1]?14:10}return 18}function i(t,i,r){this._orig=t,this._chan=i,this._tick=r}function I(t,i,r,e){var n;if(255==i.charCodeAt(0))n=p.MIDI.smf(i.charCodeAt(1),r);else{for(var o=[i.charCodeAt(0)],s=0;st.length&&this._complain(i+t.length,"Incomplete data",n-t.length)},a.prototype.validate=function(){var t,i,r=[];if(this._warn)for(t=0;t=e[a].length||(h&&(n=e[a][s[a]].tt),h=!1,n>e[a][s[a]].tt&&(n=e[a][s[a]].tt))}if(o=n,h)break}}return i._type=this.type,i._tracks=e.length,i._timing(),i},(((a.Chunk=l).prototype=[]).constructor=l).prototype.copy=function(){return new l(this.type,this.data)},l.prototype.sub={MTrk:function(t,i,r){return new C(i,r)}},l.prototype.dump=function(){return this.type+s(this.data.length)+this.data},l.prototype.toString=function(){return this.type+": "+this.data.length+" bytes"},(((a.MTrk=C).prototype=[]).constructor=C).prototype.copy=function(){for(var t=new C,i=t.length=0;it)&&!(this[e].tt==t&&v(this[e])>r);e++);return this.splice(e,0,i),this},C.prototype.send=function(t){this._orig.add(this._tick,t)},C.prototype.tick=function(t){if(t!=parseInt(t)||t<0)throw RangeError("Bad tick value: "+t);if(!t)return this;function i(){}i.prototype=this._orig;var r=new i;return r._tick=this._tick+t,r},C.prototype.note=function(t,i,r,e){return this.noteOn(t,i,r),0this._pos);this._ptr++)this._filter(t);this._ptr>=this._data.length&&(this._loop&&-1!=this._loop&&this._loop--,this._loop?(this._ptr=0,this._p0=0,this._t0=i):this.stop(),this.onEnd()),"stop"==this.event&&(this.playing=!1,this.paused=!1,this._pos=0,this._ptr=0,this.sndOff(),this.event=void 0),"pause"==this.event&&(this.playing=!1,this.paused=!0,this._pos>=this._duration&&(this._pos=this._duration-1),this._p0=this._pos,this.sndOff(),this.event=void 0),this.playing&&p.lib.schedule(this._tick)},k.prototype.trim=function(){for(var t,i=[],r=0,e=0,n=0;n=this._duration&&(t=this._duration-1),this._goto(t)},k.prototype.jumpMS=function(t){isNaN(parseFloat(t))&&d("Not a number: "+t),t<0&&(t=0),t>=this._durationMS&&(t=this._durationMS-1),this._goto(this._ms2t(t))},k.prototype._t2ms=function(t){if(!t)return 0;for(var i=0;this._ttt[i].t=this._pos)break;81==t.ff&&this.ppqn&&(this._mul=1e3*this.ppqn/A(t.dd))}this.mul=this._mul*this._speed,this._t0=r(),this._p0=this._pos},k.prototype.tick2ms=function(t){return isNaN(parseFloat(t))&&d("Not a number: "+t),t<=0?0:t>=this._duration?this._durationMS:this._t2ms(t)},k.prototype.ms2tick=function(t){return isNaN(parseFloat(t))&&d("Not a number: "+t),t<=0?0:t>=this._durationMS?this._duration:this._ms2t(t)},p.MIDI.SMF=a)}); \ No newline at end of file diff --git a/package.json b/package.json index e58159d..3e0f6c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jzz-midi-smf", - "version": "1.3.8", + "version": "1.3.9", "description": "Standard MIDI Files: read / write / play", "main": "javascript/JZZ.midi.SMF.js", "scripts": { @@ -15,14 +15,14 @@ ], "author": "jazz-soft (https://jazz-soft.net/)", "dependencies": { - "jzz": "^1.0.8" + "jzz": "^1.0.9" }, "devDependencies": { "coveralls": "^3.1.0", - "eslint": "^7.4.0", + "eslint": "^7.5.0", "grunt": "^1.2.1", "grunt-contrib-jshint": "^2.1.0", - "grunt-contrib-uglify": "^4.0.1", + "grunt-contrib-uglify": "^5.0.0", "jzz-gui-player": "^1.4.3", "jzz-synth-tiny": "^1.1.7", "mocha": "^8.0.1",