code: private int beatOffset(int beatNumber) {
          if (beatCount == 0) {
              throw new IllegalStateException("There are no beats in this beat grid.");
          }
          if (beatNumber < 1 || beatNumber > beatCount) {
              throw new IndexOutOfBoundsException("beatNumber (" + beatNumber + ") must be between 1 and " + beatCount);
          }
          return beatNumber - 1;
      }
docs: Calculate where within the beat grid array the information for the specified beat can be found.
  Yes, this is a super simple calculation; the main point of the method is to provide a nice exception
  when the beat is out of bounds.
  
  @param beatNumber the beat desired
  
  @return the offset of the start of our cache arrays for information about that beat