-
Notifications
You must be signed in to change notification settings - Fork 248
Fix MIDI pickup crossing detection never firing #3835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,7 +95,7 @@ static bool midiPickupShouldApply ( int midiValue, int currentValue, int toleran | |
| // Handles the case where rapid movement causes MIDI values to "skip over" the software value | ||
| if ( recentMidiValues.size() >= 2 ) | ||
| { | ||
| int prevMidi = recentMidiValues.back(); | ||
| int prevMidi = recentMidiValues[recentMidiValues.size() - 2]; | ||
| // Check if current and previous MIDI values bracket the software value | ||
| if ( ( prevMidi <= currentValue && midiValue >= currentValue ) || ( prevMidi >= currentValue && midiValue <= currentValue ) ) | ||
| return true; | ||
|
|
@@ -117,7 +117,11 @@ static bool midiPickupTryApply ( int midiValue, int currentValue, int tolerance, | |
| tempPickup.push_back ( midiValue ); | ||
|
|
||
| if ( !midiPickupShouldApply ( midiValue, currentValue, tolerance, tempPickup ) ) | ||
| { | ||
| // keep this value: the next message needs it to detect a crossing | ||
| pickupBuffer = tempPickup; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where's
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mcfnord please have a look at the PRs you/your agent looked at and comment...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 AI: Naming the referent: // still waiting: keep this value in the channel's recentFader/recentPan
// history so the next message can detect a crossingNot pushed — the branch still carries the one-line form. |
||
| return true; // Still waiting for pickup | ||
| } | ||
|
|
||
| // Picked up. Stop waiting | ||
| waitingForPickup = false; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.