mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
42a84932e6
The sample counter maps to song position via a factor of `speed` while the preserve-pitch effect is active and 1.0 while neutral. A change that flips active<->neutral (enable/disable, or speed crossing 1.0x) therefore needs the counter restamped to hold the position — but the condition only fired for active->active speed changes. So every enable/disable toggle reinterpreted the counter under the new factor and jumped the position (~raw_secs x dspeed — e.g. +-18 s at 180 s on a +-10% toggle). This broke Orbit drift correction, whose bang-bang nudges toggle the effect on and off with the full +-10% delta. Extract the decision into `rate_change_needs_restamp` and fire it on any active<->neutral transition (and active->active speed changes), always re-deriving the counter for the new config. Tests cover the condition and the position-stable invariant.