| 1099 | private static readonly _maxOffsetForSameLineSearch: number = 3; |
| 1100 | |
| 1101 | public static nextNoteOnSameLine(note: Note): Note | null { |
| 1102 | let nextBeat: Beat | null = note.beat.nextBeat; |
| 1103 | // keep searching in same bar |
| 1104 | while (nextBeat && nextBeat.voice.bar.index <= note.beat.voice.bar.index + Note._maxOffsetForSameLineSearch) { |
| 1105 | const noteOnString: Note | null = nextBeat.getNoteOnString(note.string); |
| 1106 | if (noteOnString) { |
| 1107 | return noteOnString; |
| 1108 | } |
| 1109 | nextBeat = nextBeat.nextBeat; |
| 1110 | } |
| 1111 | return null; |
| 1112 | } |
| 1113 | |
| 1114 | static findHammerPullDestination(note: Note): Note | null { |
| 1115 | // For Hammer-Pull destinations we have 2 potential candidates |