Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/audiomixerboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Comment thread
pljones marked this conversation as resolved.
// Check if current and previous MIDI values bracket the software value
if ( ( prevMidi <= currentValue && midiValue >= currentValue ) || ( prevMidi >= currentValue && midiValue <= currentValue ) )
return true;
Expand All @@ -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;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's pickupBuffer defined and used? (Maybe hint that in the comment - but if it's obvious, this comment is fine.)

return true; // Still waiting for pickup
}

// Picked up. Stop waiting
waitingForPickup = false;
Expand Down
Loading