// // sbnk.js //-------------------- // Reads sbnk files. // by RHY3756547 // // includes: gl-matrix.js (glMatrix 2.0) // window.sbnk = function(input, dataView) { var t = this; this.load = load; function load(input, dataView) { var view = (dataView)?input:(new DataView(input)); var header = null; var offset = 0; var stamp = readChar(view, 0x0)+readChar(view, 0x1)+readChar(view, 0x2)+readChar(view, 0x3); if (stamp != "SBNK") throw "SWAV invalid. Expected SWAV, found "+stamp; offset += 16; var data = readChar(view, offset)+readChar(view, offset+1)+readChar(view, offset+2)+readChar(view, offset+3); if (data != "DATA") throw "SWAV invalid, expected DATA, found "+data; offset += 8; offset += 32; //skip reserved var numInst = view.getUint32(offset, true); t.instruments = []; offset += 4; for (var i=0; i