pub fn quantize(position_beats: f64, grid_division: f64) -> f64
Quantize a beat position to the nearest grid division.