public BeatBounds FindBeatAtPos(float x) { BeatBounds beat = null; for (int i = 0; i < Beats.Count; i++) { if (beat == null || Beats[i].RealBounds.X < x) { beat = Beats[i]; } else if (Beats[i].RealBounds.X > x) { break; } } return beat; }