9897 - fix ticker.cc loop range end wrap#966
9897 - fix ticker.cc loop range end wrap#966jsundqvist wants to merge 2 commits intoArdour:masterfrom
Conversation
|
Nice find! now makes me wonder if |
|
@x42 EDIT: never mind. that one doesn't work with hardware, probably due to |
|
So it this pull-request ready to go? I lent my only hardware device that can be sync'ed to MIDI Clock, so I cannot test myself. |
|
No, it's accumulating a tiny bit of lag in the loop and getting out of sync, I'll convert to draft. Other related issues:
Let's see if I can make separate changes or if they need to be here. I'm running a Roland TD-27 drum module where MIDI clock is driving the modules built-in Click track, so pretty handy testbed. |
This comprehensive fix addresses multiple issues with MIDI clock sync when looping, as reported in https://tracker.ardour.org/view.php?id=9897 and discussed in PR Ardour#966. Issues fixed: 1. Stop/Continue events during loop wrap: - The discontinuity detection now recognizes loop wraps as expected transitions rather than real discontinuities - Prevents erroneous MIDI Stop events when the loop restarts - Uses reset() for real discontinuities to properly clear all state 2. Lag accumulation: - Fixed speed calculation during loop wrap to account for the actual distance traveled through the loop boundary - Improved _next_tick wrapping to prevent drift accumulation - Properly manages _transport_pos during loop transitions 3. Clock tick generation during wrap: - Generates ticks correctly in both the pre-wrap and post-wrap portions - Calculates proper buffer offsets for wrapped ticks - Handles tempo changes across loop boundaries 4. Transport position tracking: - _transport_pos is now correctly maintained during loop wraps - Prevents false discontinuity detection on subsequent cycles The fix ensures smooth MIDI clock sync through loop boundaries without sending spurious Stop/Continue messages that cause external devices to skip beats and lose synchronization.
The user has no relationship with the project, and batch approved all PR. Troll/Spam
https://tracker.ardour.org/view.php?id=9897