private void addBytesToTrackSequential(int addr, int length) {
   if (length > 0) {
     mem.memcpy(bufBytes.bufferAddr + bufBytes.writeOffset, addr, length);
     bufBytes.writeOffset += length;
     bufBytes.sizeAvailableForRead += length;
   }
 }
 public void addSamplesToTrack(int samples) {
   bufSamples.sizeAvailableForRead += samples;
   currentSample += samples;
 }