private static void FindExactHighLowNotes(List<MidiNote> notes, int startindex, int starttime,
ref int high, ref int low)
{
int i = startindex;
while (notes[i].StartTime < starttime) {
i++;
}
while (i < notes.Count && notes[i].StartTime == starttime) {
if (high < notes[i].Number) {
high = notes[i].Number;
}
if (low > notes[i].Number) {
low = notes[i].Number;
}
i++;
}
}