lookupBeamDirection(duration, prev_tick, tick, next_tick) {
    if (duration === '4') {
      return BEAM_LEFT;
    }

    const lookup_duration =  `${Flow.durationToNumber(duration) / 2}`;
    const prev_note_gets_beam = prev_tick < Flow.durationToTicks(lookup_duration);
    const next_note_gets_beam = next_tick < Flow.durationToTicks(lookup_duration);
    const note_gets_beam = tick < Flow.durationToTicks(lookup_duration);

    if (prev_note_gets_beam && next_note_gets_beam && note_gets_beam) {
      return BEAM_BOTH;
    } else if (prev_note_gets_beam && !next_note_gets_beam && note_gets_beam) {
      return BEAM_LEFT;
    } else if (!prev_note_gets_beam && next_note_gets_beam && note_gets_beam) {
      return BEAM_RIGHT;
    }

    return this.lookupBeamDirection(lookup_duration, prev_tick, tick, next_tick);
  }
// return upper level beam direction.
return upper level beam direction.
return upper level beam direction .
lookupBeamDirection(duration, prev_tick, tick, next_tick) {
    if (duration === '4') {
      return BEAM_LEFT;
    }
    const lookup_duration =  `${Flow.durationToNumber(duration) / 2}`;
    const prev_note_gets_beam = prev_tick < Flow.durationToTicks(lookup_duration);
    const next_note_gets_beam = next_tick < Flow.durationToTicks(lookup_duration);
    const note_gets_beam = tick < Flow.durationToTicks(lookup_duration);
    if (prev_note_gets_beam && next_note_gets_beam && note_gets_beam) {
      return BEAM_BOTH;
    } else if (prev_note_gets_beam && !next_note_gets_beam && note_gets_beam) {
      return BEAM_LEFT;
    } else if (!prev_note_gets_beam && next_note_gets_beam && note_gets_beam) {
      return BEAM_RIGHT;
    }
    return this.lookupBeamDirection(lookup_duration, prev_tick, tick, next_tick);
  }
lookupBeamDirection ( duration , prev_tick , tick , next_tick ) { if ( duration === '4' ) { return BEAM_LEFT ; } const lookup_duration = ` ${ Flow . durationToNumber ( duration ) / 2 } ` ; const prev_note_gets_beam = prev_tick < Flow . durationToTicks ( lookup_duration ) ; const next_note_gets_beam = next_tick < Flow . durationToTicks ( lookup_duration ) ; const note_gets_beam = tick < Flow . durationToTicks ( lookup_duration ) ; if ( prev_note_gets_beam && next_note_gets_beam && note_gets_beam ) { return BEAM_BOTH ; } else if ( prev_note_gets_beam && ! next_note_gets_beam && note_gets_beam ) { return BEAM_LEFT ; } else if ( ! prev_note_gets_beam && next_note_gets_beam && note_gets_beam ) { return BEAM_RIGHT ; } return this . lookupBeamDirection ( lookup_duration , prev_tick , tick , next_tick ) ; }
return upper level beam direction.
return upper level beam direction .