- dist = options->get_duration_space (shortest_playing_len.main_part_);
- dist *= double (delta_t.main_part_ / shortest_playing_len.main_part_);
+ // A spring of length and stiffness based on the controlling duration
+ Real len = options->get_duration_space (shortest_playing_len.main_part_);
+ Real min = options->increment_; // canonical notehead width
+
+ // The portion of that spring proportional to the time between lc and rc
+ Real fraction = (delta_t.main_part_ / shortest_playing_len.main_part_);
+ ret = Spring (fraction * len, fraction * min);
+
+ // Stretch proportional to the space between canonical bare noteheads
+ ret.set_inverse_stretch_strength (fraction * max (0.1, (len - min)));