src/components/VideoPlayer.js
// rewritten ArrayBuffer method that seems to work with .mid files NOT containing additional metadata
rewritten ArrayBuffer method that seems to work with .mid files NOT containing additional metadata
rewritten ArrayBuffer method that seems to work with . mid files NOT containing additional metadata
toArrayBuffer(file) {
    file = file.replace(/\s+/g, '');
    var ab = new ArrayBuffer(file.length/2)
    var bufferedMIDI = new Uint8Array(ab)
    var j = 0;
    for(var i = 0; i<file.length-1; i = i+2) {
      var hexString = '0x' + file.slice(i, i+2)
      var hexByte = parseInt(hexString)
      bufferedMIDI[j] = hexByte
      j = j + 1;
    }
    return ab;
  }
toArrayBuffer ( file ) { file = file . replace ( / \s+ / g , '' ) ; var ab = new ArrayBuffer ( file . length / 2 ) var bufferedMIDI = new Uint8Array ( ab ) var j = 0 ; for ( var i = 0 ; i < file . length - 1 ; i = i + 2 ) { var hexString = '0x' + file . slice ( i , i + 2 ) var hexByte = parseInt ( hexString ) bufferedMIDI [ j ] = hexByte j = j + 1 ; } return ab ; }
rewritten ArrayBuffer method that seems to work with .mid files NOT containing additional metadata
rewritten ArrayBuffer method that seems to work with . mid files NOT containing additional metadata
// console.log(hexByte, typeof hexByte)