UNPKG

museaikit

Version:

A powerful music-focused AI toolkit

1 lines 97.5 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.protobuf=t():e.protobuf=t()}(self,(()=>(()=>{"use strict";var __webpack_modules__={381:e=>{e.exports={}},1137:(e,t,n)=>{e.exports=u;var r,o=n(5382),i=o.LongBits,a=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},p=function(){return o.Buffer?function(e){return(u.create=function(e){return o.Buffer.isBuffer(e)?new r(e):l(e)})(e)}:l};function f(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function m(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw s(this,8);return new i(m(this.buf,this.pos+=4),m(this.buf,this.pos+=4))}u.create=p(),u.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return m(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|m(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},u.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){r=e,u.create=p(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(u.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},1758:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(7151),o=r.tensorflow.magenta.NoteSequence},1925:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},1979:(e,t)=>{var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),o=new Array(123),i=0;i<64;)o[r[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;n.encode=function(e,t,n){for(var o,i=null,a=[],s=0,u=0;t<n;){var c=e[t++];switch(u){case 0:a[s++]=r[c>>2],o=(3&c)<<4,u=1;break;case 1:a[s++]=r[o|c>>4],o=(15&c)<<2,u=2;break;case 2:a[s++]=r[o|c>>6],a[s++]=r[63&c],u=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=r[o],a[s++]=61,1===u&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";n.decode=function(e,t,n){for(var r,i=n,s=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&s>1)break;if(void 0===(c=o[c]))throw Error(a);switch(s){case 0:r=c,s=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,s=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,s=3;break;case 3:t[n++]=(3&r)<<6|c,s=0}}if(1===s)throw Error(a);return n-i},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},2971:(e,t)=>{var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,i=[],a=0;t<n;)(r=e[t++])<128?i[a++]=r:r>191&&r<224?i[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(r>>10),i[a++]=56320+(1023&r)):i[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},n.write=function(e,t,n){for(var r,o,i=n,a=0;a<e.length;++a)(r=e.charCodeAt(a))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&o),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-i}},3474:e=>{function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},4010:(e,t,n)=>{e.exports=i;var r=n(1137);(i.prototype=Object.create(r.prototype)).constructor=i;var o=n(5382);function i(e){r.call(this,e)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},4110:(e,t,n)=>{e.exports=n(7134)},4226:e=>{e.exports=function(e,t,n){var r=n||8192,o=r>>>1,i=null,a=r;return function(n){if(n<1||n>o)return e(n);a+n>r&&(i=e(r),a=0);var s=t.call(i,a,a+=n);return 7&a&&(a=1+(7|a)),s}}},4301:(e,t,n)=>{e.exports=p;var r,o=n(5382),i=o.LongBits,a=o.base64,s=o.utf8;function u(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var f=function(){return o.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};function m(e,t,n){t[n]=255&e}function d(e,t){this.len=e,this.next=void 0,this.val=t}function h(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}p.create=f(),p.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(p.alloc=o.pool(p.alloc,o.Array.prototype.subarray)),p.prototype._push=function(e,t,n){return this.tail=this.tail.next=new u(e,t,n),this.len+=t,this},d.prototype=Object.create(u.prototype),d.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new d((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(h,10,i.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=i.from(e);return this._push(h,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(h,t.length(),t)},p.prototype.bool=function(e){return this._push(m,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var y=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(m,1,0);if(o.isString(e)){var n=p.alloc(t=a.length(e));a.decode(e,n,0),e=n}return this.uint32(t)._push(y,t,e)},p.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(m,1,0)},p.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},p._configure=function(e){r=e,p.create=f(),r._configure()}},4447:(e,t,n)=>{e.exports=o;var r=n(5382);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return r.asPromise(e,s,t,n,o,i);if(s.rpcImpl)try{return s.rpcImpl(t,n[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,n){if(e)return s.emit("error",e,t),a(e);if(null!==n){if(!(n instanceof o))try{n=o[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",n,t),a(null,n)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},5003:(e,t,n)=>{e.exports=o;var r=n(5382);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):i},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;o.fromHash=function(e){return e===a?i:new o((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},5382:function(e,t,n){var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function i(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&o(this,n)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=n(6233),r.base64=n(1979),r.EventEmitter=n(3474),r.float=n(5750),r.inquire=n(1925),r.utf8=n(2971),r.pool=n(4226),r.LongBits=n(5003),r.isNode=Boolean("undefined"!=typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=i,r.ProtocolError=i("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},5750:e=>{function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function i(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:i,e.writeFloatBE=r?i:o,e.readFloatLE=r?a:s,e.readFloatBE=r?s:a}():function(){function t(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),o=2*(r>>31)+1,i=r>>>23&255,a=8388607&r;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=a.bind(null,o),e.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function i(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:i,e.writeDoubleBE=r?i:o,e.readDoubleLE=r?a:s,e.readDoubleBE=r?s:a}():function(){function t(e,t,n,r,o,i){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,o,i+t),e(1/r>0?0:2147483648,o,i+n);else if(isNaN(r))e(0,o,i+t),e(2146959360,o,i+n);else if(r>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(s=r*Math.pow(2,-u))>>>0,o,i+t),e((a<<31|u+1023<<20|1048576*s&1048575)>>>0,o,i+n)}}}function a(e,t,n,r,o){var i=e(r,o+t),a=e(r,o+n),s=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+i;return 2047===u?c?NaN:s*(1/0):0===u?5e-324*s*c:s*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=a.bind(null,o,0,4),e.readDoubleBE=a.bind(null,i,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},6233:e=>{e.exports=function(e,t){var n=new Array(arguments.length-1),r=0,o=2,i=!0;for(;o<arguments.length;)n[r++]=arguments[o++];return new Promise((function(o,a){n[r]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(e){i&&(i=!1,a(e))}}))}},7134:(e,t,n)=>{var r=t;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(4301),r.BufferWriter=n(8422),r.Reader=n(1137),r.BufferReader=n(4010),r.util=n(5382),r.rpc=n(9691),r.roots=n(381),r.configure=o,o()},7151:(e,t,n)=>{var r,o,i=n(4110),a=i.Reader,s=i.Writer,u=i.util,c=i.roots.default||(i.roots.default={});c.tensorflow=((o={}).magenta=((r={}).NoteSequence=function(){function e(e){if(this.timeSignatures=[],this.keySignatures=[],this.tempos=[],this.notes=[],this.pitchBends=[],this.controlChanges=[],this.partInfos=[],this.textAnnotations=[],this.sectionAnnotations=[],this.sectionGroups=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t,n;return e.prototype.id="",e.prototype.filename="",e.prototype.referenceNumber=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.collectionName="",e.prototype.ticksPerQuarter=0,e.prototype.timeSignatures=u.emptyArray,e.prototype.keySignatures=u.emptyArray,e.prototype.tempos=u.emptyArray,e.prototype.notes=u.emptyArray,e.prototype.totalTime=0,e.prototype.totalQuantizedSteps=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.pitchBends=u.emptyArray,e.prototype.controlChanges=u.emptyArray,e.prototype.partInfos=u.emptyArray,e.prototype.sourceInfo=null,e.prototype.textAnnotations=u.emptyArray,e.prototype.sectionAnnotations=u.emptyArray,e.prototype.sectionGroups=u.emptyArray,e.prototype.quantizationInfo=null,e.prototype.subsequenceInfo=null,e.prototype.sequenceMetadata=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=s.create()),null!=e.id&&e.hasOwnProperty("id")&&t.uint32(10).string(e.id),null!=e.filename&&e.hasOwnProperty("filename")&&t.uint32(18).string(e.filename),null!=e.collectionName&&e.hasOwnProperty("collectionName")&&t.uint32(26).string(e.collectionName),null!=e.ticksPerQuarter&&e.hasOwnProperty("ticksPerQuarter")&&t.uint32(32).int32(e.ticksPerQuarter),null!=e.timeSignatures&&e.timeSignatures.length)for(var n=0;n<e.timeSignatures.length;++n)c.tensorflow.magenta.NoteSequence.TimeSignature.encode(e.timeSignatures[n],t.uint32(42).fork()).ldelim();if(null!=e.keySignatures&&e.keySignatures.length)for(n=0;n<e.keySignatures.length;++n)c.tensorflow.magenta.NoteSequence.KeySignature.encode(e.keySignatures[n],t.uint32(50).fork()).ldelim();if(null!=e.tempos&&e.tempos.length)for(n=0;n<e.tempos.length;++n)c.tensorflow.magenta.NoteSequence.Tempo.encode(e.tempos[n],t.uint32(58).fork()).ldelim();if(null!=e.notes&&e.notes.length)for(n=0;n<e.notes.length;++n)c.tensorflow.magenta.NoteSequence.Note.encode(e.notes[n],t.uint32(66).fork()).ldelim();if(null!=e.totalTime&&e.hasOwnProperty("totalTime")&&t.uint32(73).double(e.totalTime),null!=e.pitchBends&&e.pitchBends.length)for(n=0;n<e.pitchBends.length;++n)c.tensorflow.magenta.NoteSequence.PitchBend.encode(e.pitchBends[n],t.uint32(82).fork()).ldelim();if(null!=e.controlChanges&&e.controlChanges.length)for(n=0;n<e.controlChanges.length;++n)c.tensorflow.magenta.NoteSequence.ControlChange.encode(e.controlChanges[n],t.uint32(90).fork()).ldelim();if(null!=e.partInfos&&e.partInfos.length)for(n=0;n<e.partInfos.length;++n)c.tensorflow.magenta.NoteSequence.PartInfo.encode(e.partInfos[n],t.uint32(98).fork()).ldelim();if(null!=e.sourceInfo&&e.hasOwnProperty("sourceInfo")&&c.tensorflow.magenta.NoteSequence.SourceInfo.encode(e.sourceInfo,t.uint32(106).fork()).ldelim(),null!=e.textAnnotations&&e.textAnnotations.length)for(n=0;n<e.textAnnotations.length;++n)c.tensorflow.magenta.NoteSequence.TextAnnotation.encode(e.textAnnotations[n],t.uint32(114).fork()).ldelim();if(null!=e.quantizationInfo&&e.hasOwnProperty("quantizationInfo")&&c.tensorflow.magenta.NoteSequence.QuantizationInfo.encode(e.quantizationInfo,t.uint32(122).fork()).ldelim(),null!=e.totalQuantizedSteps&&e.hasOwnProperty("totalQuantizedSteps")&&t.uint32(128).int64(e.totalQuantizedSteps),null!=e.subsequenceInfo&&e.hasOwnProperty("subsequenceInfo")&&c.tensorflow.magenta.NoteSequence.SubsequenceInfo.encode(e.subsequenceInfo,t.uint32(138).fork()).ldelim(),null!=e.referenceNumber&&e.hasOwnProperty("referenceNumber")&&t.uint32(144).int64(e.referenceNumber),null!=e.sequenceMetadata&&e.hasOwnProperty("sequenceMetadata")&&c.tensorflow.magenta.SequenceMetadata.encode(e.sequenceMetadata,t.uint32(154).fork()).ldelim(),null!=e.sectionAnnotations&&e.sectionAnnotations.length)for(n=0;n<e.sectionAnnotations.length;++n)c.tensorflow.magenta.NoteSequence.SectionAnnotation.encode(e.sectionAnnotations[n],t.uint32(162).fork()).ldelim();if(null!=e.sectionGroups&&e.sectionGroups.length)for(n=0;n<e.sectionGroups.length;++n)c.tensorflow.magenta.NoteSequence.SectionGroup.encode(e.sectionGroups[n],t.uint32(170).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.tensorflow.magenta.NoteSequence;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.id=e.string();break;case 2:r.filename=e.string();break;case 18:r.referenceNumber=u.Long?e.int64().toNumber():e.int64();break;case 3:r.collectionName=e.string();break;case 4:r.ticksPerQuarter=e.int32();break;case 5:r.timeSignatures&&r.timeSignatures.length||(r.timeSignatures=[]),r.timeSignatures.push(c.tensorflow.magenta.NoteSequence.TimeSignature.decode(e,e.uint32()));break;case 6:r.keySignatures&&r.keySignatures.length||(r.keySignatures=[]),r.keySignatures.push(c.tensorflow.magenta.NoteSequence.KeySignature.decode(e,e.uint32()));break;case 7:r.tempos&&r.tempos.length||(r.tempos=[]),r.tempos.push(c.tensorflow.magenta.NoteSequence.Tempo.decode(e,e.uint32()));break;case 8:r.notes&&r.notes.length||(r.notes=[]),r.notes.push(c.tensorflow.magenta.NoteSequence.Note.decode(e,e.uint32()));break;case 9:r.totalTime=e.double();break;case 16:r.totalQuantizedSteps=u.Long?e.int64().toNumber():e.int64();break;case 10:r.pitchBends&&r.pitchBends.length||(r.pitchBends=[]),r.pitchBends.push(c.tensorflow.magenta.NoteSequence.PitchBend.decode(e,e.uint32()));break;case 11:r.controlChanges&&r.controlChanges.length||(r.controlChanges=[]),r.controlChanges.push(c.tensorflow.magenta.NoteSequence.ControlChange.decode(e,e.uint32()));break;case 12:r.partInfos&&r.partInfos.length||(r.partInfos=[]),r.partInfos.push(c.tensorflow.magenta.NoteSequence.PartInfo.decode(e,e.uint32()));break;case 13:r.sourceInfo=c.tensorflow.magenta.NoteSequence.SourceInfo.decode(e,e.uint32());break;case 14:r.textAnnotations&&r.textAnnotations.length||(r.textAnnotations=[]),r.textAnnotations.push(c.tensorflow.magenta.NoteSequence.TextAnnotation.decode(e,e.uint32()));break;case 20:r.sectionAnnotations&&r.sectionAnnotations.length||(r.sectionAnnotations=[]),r.sectionAnnotations.push(c.tensorflow.magenta.NoteSequence.SectionAnnotation.decode(e,e.uint32()));break;case 21:r.sectionGroups&&r.sectionGroups.length||(r.sectionGroups=[]),r.sectionGroups.push(c.tensorflow.magenta.NoteSequence.SectionGroup.decode(e,e.uint32()));break;case 15:r.quantizationInfo=c.tensorflow.magenta.NoteSequence.QuantizationInfo.decode(e,e.uint32());break;case 17:r.subsequenceInfo=c.tensorflow.magenta.NoteSequence.SubsequenceInfo.decode(e,e.uint32());break;case 19:r.sequenceMetadata=c.tensorflow.magenta.SequenceMetadata.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.id&&e.hasOwnProperty("id")&&!u.isString(e.id))return"id: string expected";if(null!=e.filename&&e.hasOwnProperty("filename")&&!u.isString(e.filename))return"filename: string expected";if(null!=e.referenceNumber&&e.hasOwnProperty("referenceNumber")&&!(u.isInteger(e.referenceNumber)||e.referenceNumber&&u.isInteger(e.referenceNumber.low)&&u.isInteger(e.referenceNumber.high)))return"referenceNumber: integer|Long expected";if(null!=e.collectionName&&e.hasOwnProperty("collectionName")&&!u.isString(e.collectionName))return"collectionName: string expected";if(null!=e.ticksPerQuarter&&e.hasOwnProperty("ticksPerQuarter")&&!u.isInteger(e.ticksPerQuarter))return"ticksPerQuarter: integer expected";if(null!=e.timeSignatures&&e.hasOwnProperty("timeSignatures")){if(!Array.isArray(e.timeSignatures))return"timeSignatures: array expected";for(var t=0;t<e.timeSignatures.length;++t)if(n=c.tensorflow.magenta.NoteSequence.TimeSignature.verify(e.timeSignatures[t]))return"timeSignatures."+n}if(null!=e.keySignatures&&e.hasOwnProperty("keySignatures")){if(!Array.isArray(e.keySignatures))return"keySignatures: array expected";for(t=0;t<e.keySignatures.length;++t)if(n=c.tensorflow.magenta.NoteSequence.KeySignature.verify(e.keySignatures[t]))return"keySignatures."+n}if(null!=e.tempos&&e.hasOwnProperty("tempos")){if(!Array.isArray(e.tempos))return"tempos: array expected";for(t=0;t<e.tempos.length;++t)if(n=c.tensorflow.magenta.NoteSequence.Tempo.verify(e.tempos[t]))return"tempos."+n}if(null!=e.notes&&e.hasOwnProperty("notes")){if(!Array.isArray(e.notes))return"notes: array expected";for(t=0;t<e.notes.length;++t)if(n=c.tensorflow.magenta.NoteSequence.Note.verify(e.notes[t]))return"notes."+n}if(null!=e.totalTime&&e.hasOwnProperty("totalTime")&&"number"!=typeof e.totalTime)return"totalTime: number expected";if(null!=e.totalQuantizedSteps&&e.hasOwnProperty("totalQuantizedSteps")&&!(u.isInteger(e.totalQuantizedSteps)||e.totalQuantizedSteps&&u.isInteger(e.totalQuantizedSteps.low)&&u.isInteger(e.totalQuantizedSteps.high)))return"totalQuantizedSteps: integer|Long expected";if(null!=e.pitchBends&&e.hasOwnProperty("pitchBends")){if(!Array.isArray(e.pitchBends))return"pitchBends: array expected";for(t=0;t<e.pitchBends.length;++t)if(n=c.tensorflow.magenta.NoteSequence.PitchBend.verify(e.pitchBends[t]))return"pitchBends."+n}if(null!=e.controlChanges&&e.hasOwnProperty("controlChanges")){if(!Array.isArray(e.controlChanges))return"controlChanges: array expected";for(t=0;t<e.controlChanges.length;++t)if(n=c.tensorflow.magenta.NoteSequence.ControlChange.verify(e.controlChanges[t]))return"controlChanges."+n}if(null!=e.partInfos&&e.hasOwnProperty("partInfos")){if(!Array.isArray(e.partInfos))return"partInfos: array expected";for(t=0;t<e.partInfos.length;++t)if(n=c.tensorflow.magenta.NoteSequence.PartInfo.verify(e.partInfos[t]))return"partInfos."+n}if(null!=e.sourceInfo&&e.hasOwnProperty("sourceInfo")&&(n=c.tensorflow.magenta.NoteSequence.SourceInfo.verify(e.sourceInfo)))return"sourceInfo."+n;if(null!=e.textAnnotations&&e.hasOwnProperty("textAnnotations")){if(!Array.isArray(e.textAnnotations))return"textAnnotations: array expected";for(t=0;t<e.textAnnotations.length;++t)if(n=c.tensorflow.magenta.NoteSequence.TextAnnotation.verify(e.textAnnotations[t]))return"textAnnotations."+n}if(null!=e.sectionAnnotations&&e.hasOwnProperty("sectionAnnotations")){if(!Array.isArray(e.sectionAnnotations))return"sectionAnnotations: array expected";for(t=0;t<e.sectionAnnotations.length;++t)if(n=c.tensorflow.magenta.NoteSequence.SectionAnnotation.verify(e.sectionAnnotations[t]))return"sectionAnnotations."+n}if(null!=e.sectionGroups&&e.hasOwnProperty("sectionGroups")){if(!Array.isArray(e.sectionGroups))return"sectionGroups: array expected";for(t=0;t<e.sectionGroups.length;++t){var n;if(n=c.tensorflow.magenta.NoteSequence.SectionGroup.verify(e.sectionGroups[t]))return"sectionGroups."+n}}return null!=e.quantizationInfo&&e.hasOwnProperty("quantizationInfo")&&(n=c.tensorflow.magenta.NoteSequence.QuantizationInfo.verify(e.quantizationInfo))?"quantizationInfo."+n:null!=e.subsequenceInfo&&e.hasOwnProperty("subsequenceInfo")&&(n=c.tensorflow.magenta.NoteSequence.SubsequenceInfo.verify(e.subsequenceInfo))?"subsequenceInfo."+n:null!=e.sequenceMetadata&&e.hasOwnProperty("sequenceMetadata")&&(n=c.tensorflow.magenta.SequenceMetadata.verify(e.sequenceMetadata))?"sequenceMetadata."+n:null},e.fromObject=function(e){if(e instanceof c.tensorflow.magenta.NoteSequence)return e;var t=new c.tensorflow.magenta.NoteSequence;if(null!=e.id&&(t.id=String(e.id)),null!=e.filename&&(t.filename=String(e.filename)),null!=e.referenceNumber&&(u.Long?(t.referenceNumber=u.Long.fromValue(e.referenceNumber)).unsigned=!1:"string"==typeof e.referenceNumber?t.referenceNumber=parseInt(e.referenceNumber,10):"number"==typeof e.referenceNumber?t.referenceNumber=e.referenceNumber:"object"==typeof e.referenceNumber&&(t.referenceNumber=new u.LongBits(e.referenceNumber.low>>>0,e.referenceNumber.high>>>0).toNumber())),null!=e.collectionName&&(t.collectionName=String(e.collectionName)),null!=e.ticksPerQuarter&&(t.ticksPerQuarter=0|e.ticksPerQuarter),e.timeSignatures){if(!Array.isArray(e.timeSignatures))throw TypeError(".tensorflow.magenta.NoteSequence.timeSignatures: array expected");t.timeSignatures=[];for(var n=0;n<e.timeSignatures.length;++n){if("object"!=typeof e.timeSignatures[n])throw TypeError(".tensorflow.magenta.NoteSequence.timeSignatures: object expected");t.timeSignatures[n]=c.tensorflow.magenta.NoteSequence.TimeSignature.fromObject(e.timeSignatures[n])}}if(e.keySignatures){if(!Array.isArray(e.keySignatures))throw TypeError(".tensorflow.magenta.NoteSequence.keySignatures: array expected");for(t.keySignatures=[],n=0;n<e.keySignatures.length;++n){if("object"!=typeof e.keySignatures[n])throw TypeError(".tensorflow.magenta.NoteSequence.keySignatures: object expected");t.keySignatures[n]=c.tensorflow.magenta.NoteSequence.KeySignature.fromObject(e.keySignatures[n])}}if(e.tempos){if(!Array.isArray(e.tempos))throw TypeError(".tensorflow.magenta.NoteSequence.tempos: array expected");for(t.tempos=[],n=0;n<e.tempos.length;++n){if("object"!=typeof e.tempos[n])throw TypeError(".tensorflow.magenta.NoteSequence.tempos: object expected");t.tempos[n]=c.tensorflow.magenta.NoteSequence.Tempo.fromObject(e.tempos[n])}}if(e.notes){if(!Array.isArray(e.notes))throw TypeError(".tensorflow.magenta.NoteSequence.notes: array expected");for(t.notes=[],n=0;n<e.notes.length;++n){if("object"!=typeof e.notes[n])throw TypeError(".tensorflow.magenta.NoteSequence.notes: object expected");t.notes[n]=c.tensorflow.magenta.NoteSequence.Note.fromObject(e.notes[n])}}if(null!=e.totalTime&&(t.totalTime=Number(e.totalTime)),null!=e.totalQuantizedSteps&&(u.Long?(t.totalQuantizedSteps=u.Long.fromValue(e.totalQuantizedSteps)).unsigned=!1:"string"==typeof e.totalQuantizedSteps?t.totalQuantizedSteps=parseInt(e.totalQuantizedSteps,10):"number"==typeof e.totalQuantizedSteps?t.totalQuantizedSteps=e.totalQuantizedSteps:"object"==typeof e.totalQuantizedSteps&&(t.totalQuantizedSteps=new u.LongBits(e.totalQuantizedSteps.low>>>0,e.totalQuantizedSteps.high>>>0).toNumber())),e.pitchBends){if(!Array.isArray(e.pitchBends))throw TypeError(".tensorflow.magenta.NoteSequence.pitchBends: array expected");for(t.pitchBends=[],n=0;n<e.pitchBends.length;++n){if("object"!=typeof e.pitchBends[n])throw TypeError(".tensorflow.magenta.NoteSequence.pitchBends: object expected");t.pitchBends[n]=c.tensorflow.magenta.NoteSequence.PitchBend.fromObject(e.pitchBends[n])}}if(e.controlChanges){if(!Array.isArray(e.controlChanges))throw TypeError(".tensorflow.magenta.NoteSequence.controlChanges: array expected");for(t.controlChanges=[],n=0;n<e.controlChanges.length;++n){if("object"!=typeof e.controlChanges[n])throw TypeError(".tensorflow.magenta.NoteSequence.controlChanges: object expected");t.controlChanges[n]=c.tensorflow.magenta.NoteSequence.ControlChange.fromObject(e.controlChanges[n])}}if(e.partInfos){if(!Array.isArray(e.partInfos))throw TypeError(".tensorflow.magenta.NoteSequence.partInfos: array expected");for(t.partInfos=[],n=0;n<e.partInfos.length;++n){if("object"!=typeof e.partInfos[n])throw TypeError(".tensorflow.magenta.NoteSequence.partInfos: object expected");t.partInfos[n]=c.tensorflow.magenta.NoteSequence.PartInfo.fromObject(e.partInfos[n])}}if(null!=e.sourceInfo){if("object"!=typeof e.sourceInfo)throw TypeError(".tensorflow.magenta.NoteSequence.sourceInfo: object expected");t.sourceInfo=c.tensorflow.magenta.NoteSequence.SourceInfo.fromObject(e.sourceInfo)}if(e.textAnnotations){if(!Array.isArray(e.textAnnotations))throw TypeError(".tensorflow.magenta.NoteSequence.textAnnotations: array expected");for(t.textAnnotations=[],n=0;n<e.textAnnotations.length;++n){if("object"!=typeof e.textAnnotations[n])throw TypeError(".tensorflow.magenta.NoteSequence.textAnnotations: object expected");t.textAnnotations[n]=c.tensorflow.magenta.NoteSequence.TextAnnotation.fromObject(e.textAnnotations[n])}}if(e.sectionAnnotations){if(!Array.isArray(e.sectionAnnotations))throw TypeError(".tensorflow.magenta.NoteSequence.sectionAnnotations: array expected");for(t.sectionAnnotations=[],n=0;n<e.sectionAnnotations.length;++n){if("object"!=typeof e.sectionAnnotations[n])throw TypeError(".tensorflow.magenta.NoteSequence.sectionAnnotations: object expected");t.sectionAnnotations[n]=c.tensorflow.magenta.NoteSequence.SectionAnnotation.fromObject(e.sectionAnnotations[n])}}if(e.sectionGroups){if(!Array.isArray(e.sectionGroups))throw TypeError(".tensorflow.magenta.NoteSequence.sectionGroups: array expected");for(t.sectionGroups=[],n=0;n<e.sectionGroups.length;++n){if("object"!=typeof e.sectionGroups[n])throw TypeError(".tensorflow.magenta.NoteSequence.sectionGroups: object expected");t.sectionGroups[n]=c.tensorflow.magenta.NoteSequence.SectionGroup.fromObject(e.sectionGroups[n])}}if(null!=e.quantizationInfo){if("object"!=typeof e.quantizationInfo)throw TypeError(".tensorflow.magenta.NoteSequence.quantizationInfo: object expected");t.quantizationInfo=c.tensorflow.magenta.NoteSequence.QuantizationInfo.fromObject(e.quantizationInfo)}if(null!=e.subsequenceInfo){if("object"!=typeof e.subsequenceInfo)throw TypeError(".tensorflow.magenta.NoteSequence.subsequenceInfo: object expected");t.subsequenceInfo=c.tensorflow.magenta.NoteSequence.SubsequenceInfo.fromObject(e.subsequenceInfo)}if(null!=e.sequenceMetadata){if("object"!=typeof e.sequenceMetadata)throw TypeError(".tensorflow.magenta.NoteSequence.sequenceMetadata: object expected");t.sequenceMetadata=c.tensorflow.magenta.SequenceMetadata.fromObject(e.sequenceMetadata)}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.timeSignatures=[],n.keySignatures=[],n.tempos=[],n.notes=[],n.pitchBends=[],n.controlChanges=[],n.partInfos=[],n.textAnnotations=[],n.sectionAnnotations=[],n.sectionGroups=[]),t.defaults){if(n.id="",n.filename="",n.collectionName="",n.ticksPerQuarter=0,n.totalTime=0,n.sourceInfo=null,n.quantizationInfo=null,u.Long){var r=new u.Long(0,0,!1);n.totalQuantizedSteps=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.totalQuantizedSteps=t.longs===String?"0":0;n.subsequenceInfo=null,u.Long?(r=new u.Long(0,0,!1),n.referenceNumber=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.referenceNumber=t.longs===String?"0":0,n.sequenceMetadata=null}if(null!=e.id&&e.hasOwnProperty("id")&&(n.id=e.id),null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),null!=e.collectionName&&e.hasOwnProperty("collectionName")&&(n.collectionName=e.collectionName),null!=e.ticksPerQuarter&&e.hasOwnProperty("ticksPerQuarter")&&(n.ticksPerQuarter=e.ticksPerQuarter),e.timeSignatures&&e.timeSignatures.length){n.timeSignatures=[];for(var o=0;o<e.timeSignatures.length;++o)n.timeSignatures[o]=c.tensorflow.magenta.NoteSequence.TimeSignature.toObject(e.timeSignatures[o],t)}if(e.keySignatures&&e.keySignatures.length)for(n.keySignatures=[],o=0;o<e.keySignatures.length;++o)n.keySignatures[o]=c.tensorflow.magenta.NoteSequence.KeySignature.toObject(e.keySignatures[o],t);if(e.tempos&&e.tempos.length)for(n.tempos=[],o=0;o<e.tempos.length;++o)n.tempos[o]=c.tensorflow.magenta.NoteSequence.Tempo.toObject(e.tempos[o],t);if(e.notes&&e.notes.length)for(n.notes=[],o=0;o<e.notes.length;++o)n.notes[o]=c.tensorflow.magenta.NoteSequence.Note.toObject(e.notes[o],t);if(null!=e.totalTime&&e.hasOwnProperty("totalTime")&&(n.totalTime=t.json&&!isFinite(e.totalTime)?String(e.totalTime):e.totalTime),e.pitchBends&&e.pitchBends.length)for(n.pitchBends=[],o=0;o<e.pitchBends.length;++o)n.pitchBends[o]=c.tensorflow.magenta.NoteSequence.PitchBend.toObject(e.pitchBends[o],t);if(e.controlChanges&&e.controlChanges.length)for(n.controlChanges=[],o=0;o<e.controlChanges.length;++o)n.controlChanges[o]=c.tensorflow.magenta.NoteSequence.ControlChange.toObject(e.controlChanges[o],t);if(e.partInfos&&e.partInfos.length)for(n.partInfos=[],o=0;o<e.partInfos.length;++o)n.partInfos[o]=c.tensorflow.magenta.NoteSequence.PartInfo.toObject(e.partInfos[o],t);if(null!=e.sourceInfo&&e.hasOwnProperty("sourceInfo")&&(n.sourceInfo=c.tensorflow.magenta.NoteSequence.SourceInfo.toObject(e.sourceInfo,t)),e.textAnnotations&&e.textAnnotations.length)for(n.textAnnotations=[],o=0;o<e.textAnnotations.length;++o)n.textAnnotations[o]=c.tensorflow.magenta.NoteSequence.TextAnnotation.toObject(e.textAnnotations[o],t);if(null!=e.quantizationInfo&&e.hasOwnProperty("quantizationInfo")&&(n.quantizationInfo=c.tensorflow.magenta.NoteSequence.QuantizationInfo.toObject(e.quantizationInfo,t)),null!=e.totalQuantizedSteps&&e.hasOwnProperty("totalQuantizedSteps")&&("number"==typeof e.totalQuantizedSteps?n.totalQuantizedSteps=t.longs===String?String(e.totalQuantizedSteps):e.totalQuantizedSteps:n.totalQuantizedSteps=t.longs===String?u.Long.prototype.toString.call(e.totalQuantizedSteps):t.longs===Number?new u.LongBits(e.totalQuantizedSteps.low>>>0,e.totalQuantizedSteps.high>>>0).toNumber():e.totalQuantizedSteps),null!=e.subsequenceInfo&&e.hasOwnProperty("subsequenceInfo")&&(n.subsequenceInfo=c.tensorflow.magenta.NoteSequence.SubsequenceInfo.toObject(e.subsequenceInfo,t)),null!=e.referenceNumber&&e.hasOwnProperty("referenceNumber")&&("number"==typeof e.referenceNumber?n.referenceNumber=t.longs===String?String(e.referenceNumber):e.referenceNumber:n.referenceNumber=t.longs===String?u.Long.prototype.toString.call(e.referenceNumber):t.longs===Number?new u.LongBits(e.referenceNumber.low>>>0,e.referenceNumber.high>>>0).toNumber():e.referenceNumber),null!=e.sequenceMetadata&&e.hasOwnProperty("sequenceMetadata")&&(n.sequenceMetadata=c.tensorflow.magenta.SequenceMetadata.toObject(e.sequenceMetadata,t)),e.sectionAnnotations&&e.sectionAnnotations.length)for(n.sectionAnnotations=[],o=0;o<e.sectionAnnotations.length;++o)n.sectionAnnotations[o]=c.tensorflow.magenta.NoteSequence.SectionAnnotation.toObject(e.sectionAnnotations[o],t);if(e.sectionGroups&&e.sectionGroups.length)for(n.sectionGroups=[],o=0;o<e.sectionGroups.length;++o)n.sectionGroups[o]=c.tensorflow.magenta.NoteSequence.SectionGroup.toObject(e.sectionGroups[o],t);return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},e.Note=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.pitch=0,e.prototype.pitchName=0,e.prototype.velocity=0,e.prototype.startTime=0,e.prototype.quantizedStartStep=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.endTime=0,e.prototype.quantizedEndStep=u.Long?u.Long.fromBits(0,0,!1):0,e.prototype.numerator=0,e.prototype.denominator=0,e.prototype.instrument=0,e.prototype.program=0,e.prototype.isDrum=!1,e.prototype.part=0,e.prototype.voice=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=s.create()),null!=e.pitch&&e.hasOwnProperty("pitch")&&t.uint32(8).int32(e.pitch),null!=e.velocity&&e.hasOwnProperty("velocity")&&t.uint32(16).int32(e.velocity),null!=e.startTime&&e.hasOwnProperty("startTime")&&t.uint32(25).double(e.startTime),null!=e.endTime&&e.hasOwnProperty("endTime")&&t.uint32(33).double(e.endTime),null!=e.numerator&&e.hasOwnProperty("numerator")&&t.uint32(40).int32(e.numerator),null!=e.denominator&&e.hasOwnProperty("denominator")&&t.uint32(48).int32(e.denominator),null!=e.instrument&&e.hasOwnProperty("instrument")&&t.uint32(56).int32(e.instrument),null!=e.program&&e.hasOwnProperty("program")&&t.uint32(64).int32(e.program),null!=e.isDrum&&e.hasOwnProperty("isDrum")&&t.uint32(72).bool(e.isDrum),null!=e.part&&e.hasOwnProperty("part")&&t.uint32(80).int32(e.part),null!=e.pitchName&&e.hasOwnProperty("pitchName")&&t.uint32(88).int32(e.pitchName),null!=e.voice&&e.hasOwnProperty("voice")&&t.uint32(96).int32(e.voice),null!=e.quantizedStartStep&&e.hasOwnProperty("quantizedStartStep")&&t.uint32(104).int64(e.quantizedStartStep),null!=e.quantizedEndStep&&e.hasOwnProperty("quantizedEndStep")&&t.uint32(112).int64(e.quantizedEndStep),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new c.tensorflow.magenta.NoteSequence.Note;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.pitch=e.int32();break;case 11:r.pitchName=e.int32();break;case 2:r.velocity=e.int32();break;case 3:r.startTime=e.double();break;case 13:r.quantizedStartStep=u.Long?e.int64().toNumber():e.int64();break;case 4:r.endTime=e.double();break;case 14:r.quantizedEndStep=u.Long?e.int64().toNumber():e.int64();break;case 5:r.numerator=e.int32();break;case 6:r.denominator=e.int32();break;case 7:r.instrument=e.int32();break;case 8:r.program=e.int32();break;case 9:r.isDrum=e.bool();break;case 10:r.part=e.int32();break;case 12:r.voice=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.pitch&&e.hasOwnProperty("pitch")&&!u.isInteger(e.pitch))return"pitch: integer expected";if(null!=e.pitchName&&e.hasOwnProperty("pitchName"))switch(e.pitchName){default:return"pitchName: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:}return null!=e.velocity&&e.hasOwnProperty("velocity")&&!u.isInteger(e.velocity)?"velocity: integer expected":null!=e.startTime&&e.hasOwnProperty("startTime")&&"number"!=typeof e.startTime?"startTime: number expected":null!=e.quantizedStartStep&&e.hasOwnProperty("quantizedStartStep")&&!(u.isInteger(e.quantizedStartStep)||e.quantizedStartStep&&u.isInteger(e.quantizedStartStep.low)&&u.isInteger(e.quantizedStartStep.high))?"quantizedStartStep: integer|Long expected":null!=e.endTime&&e.hasOwnProperty("endTime")&&"number"!=typeof e.endTime?"endTime: number expected":null!=e.quantizedEndStep&&e.hasOwnProperty("quantizedEndStep")&&!(u.isInteger(e.quantizedEndStep)||e.quantizedEndStep&&u.isInteger(e.quantizedEndStep.low)&&u.isInteger(e.quantizedEndStep.high))?"quantizedEndStep: integer|Long expected":null!=e.numerator&&e.hasOwnProperty("numerator")&&!u.isInteger(e.numerator)?"numerator: integer expected":null!=e.denominator&&e.hasOwnProperty("denominator")&&!u.isInteger(e.denominator)?"denominator: integer expected":null!=e.instrument&&e.hasOwnProperty("instrument")&&!u.isInteger(e.instrument)?"instrument: integer expected":null!=e.program&&e.hasOwnProperty("program")&&!u.isInteger(e.program)?"program: integer expected":null!=e.isDrum&&e.hasOwnProperty("isDrum")&&"boolean"!=typeof e.isDrum?"isDrum: boolean expected":null!=e.part&&e.hasOwnProperty("part")&&!u.isInteger(e.part)?"part: integer expected":null!=e.voice&&e.hasOwnProperty("voice")&&!u.isInteger(e.voice)?"voice: integer expected":null},e.fromObject=function(e){if(e instanceof c.tensorflow.magenta.NoteSequence.Note)return e;var t=new c.tensorflow.magenta.NoteSequence.Note;switch(null!=e.pitch&&(t.pitch=0|e.pitch),e.pitchName){case"UNKNOWN_PITCH_NAME":case 0:t.pitchName=0;break;case"F_FLAT_FLAT":case 1:t.pitchName=1;break;case"C_FLAT_FLAT":case 2:t.pitchName=2;break;case"G_FLAT_FLAT":case 3:t.pitchName=3;break;case"D_FLAT_FLAT":case 4:t.pitchName=4;break;case"A_FLAT_FLAT":case 5:t.pitchName=5;break;case"E_FLAT_FLAT":case 6:t.pitchName=6;break;case"B_FLAT_FLAT":case 7:t.pitchName=7;break;case"F_FLAT":case 8:t.pitchName=8;break;case"C_FLAT":case 9:t.pitchName=9;break;case"G_FLAT":case 10:t.pitchName=10;break;case"D_FLAT":case 11:t.pitchName=11;break;case"A_FLAT":case 12:t.pitchName=12;break;case"E_FLAT":case 13:t.pitchName=13;break;case"B_FLAT":case 14:t.pitchName=14;break;case"F":case 15:t.pitchName=15;break;case"C":case 16:t.pitchName=16;break;case"G":case 17:t.pitchName=17;break;case"D":case 18:t.pitchName=18;break;case"A":case 19:t.pitchName=19;break;case"E":case 20:t.pitchName=20;break;case"B":case 21:t.pitchName=21;break;case"F_SHARP":case 22:t.pitchName=22;break;case"C_SHARP":case 23:t.pitchName=23;break;case"G_SHARP":case 24:t.pitchName=24;break;case"D_SHARP":case 25:t.pitchName=25;break;case"A_SHARP":case 26:t.pitchName=26;break;case"E_SHARP":case 27:t.pitchName=27;break;case"B_SHARP":case 28:t.pitchName=28;break;case"F_SHARP_SHARP":case 29:t.pitchName=29;break;case"C_SHARP_SHARP":case 30:t.pitchName=30;break;case"G_SHARP_SHARP":case 31:t.pitchName=31;break;case"D_SHARP_SHARP":case 32:t.pitchName=32;break;case"A_SHARP_SHARP":case 33:t.pitchName=33;break;case"E_SHARP_SHARP":case 34:t.pitchName=34;break;case"B_SHARP_SHARP":case 35:t.pitchName=35}return null!=e.velocity&&(t.velocity=0|e.velocity),null!=e.startTime&&(t.startTime=Number(e.startTime)),null!=e.quantizedStartStep&&(u.Long?(t.quantizedStartStep=u.Long.fromValue(e.quantizedStartStep)).unsigned=!1:"string"==typeof e.quantizedStartStep?t.quantizedStartStep=parseInt(e.quantizedStartStep,10):"number"==typeof e.quantizedStartStep?t.quantizedStartStep=e.quantizedStartStep:"object"==typeof e.quantizedStartStep&&(t.quantizedStartStep=new u.LongBits(e.quantizedStartStep.low>>>0,e.quantizedStartStep.high>>>0).toNumber())),null!=e.endTime&&(t.endTime=Number(e.endTime)),null!=e.quantiz