function scheduler() {
      // how far ahead to schedule beat playback, in seconds
      const scheduleAheadTime = 0.1

      // schedule next beat if it falls within the next 100ms
      while (this.nextBeatTime < this.audio.currentTime + scheduleAheadTime) {
        this.scheduleBeat(this.currentBeat, this.nextBeatTime);
        this.nextNote();
      }
    }
/**
     * scheduler() looks ahead 100ms and schedules playback of any beats
     * that will occur within that time. It will always play the first beat
     * when togglePlay() is called.
     */
scheduler() looks ahead 100ms and schedules playback of any beats
that will occur within that time. It will always play the first beat
when togglePlay() is called.
scheduler () looks ahead 100ms and schedules playback of any beats that will occur within that time . It will always play the first beat when togglePlay () is called .
function scheduler() {
      const scheduleAheadTime = 0.1
      while (this.nextBeatTime < this.audio.currentTime + scheduleAheadTime) {
        this.scheduleBeat(this.currentBeat, this.nextBeatTime);
        this.nextNote();
      }
    }
function scheduler ( ) { const scheduleAheadTime = 0.1 while ( this . nextBeatTime < this . audio . currentTime + scheduleAheadTime ) { this . scheduleBeat ( this . currentBeat , this . nextBeatTime ) ; this . nextNote ( ) ; } }
scheduler() looks ahead 100ms and schedules playback of any beats
 that will occur within that time.
scheduler () looks ahead 100ms and schedules playback of any beats that will occur within that time .
// how far ahead to schedule beat playback, in seconds // schedule next beat if it falls within the next 100ms