jcsteh / osara

OSARA: Open Source Accessibility for the REAPER Application
GNU General Public License v2.0
127 stars 46 forks source link

Show Only Events That Pass Filter Causing Problems With Osara's Chord Navigation #625

Closed MatejGolian closed 2 years ago

MatejGolian commented 2 years ago

Hello all,

This seems a biggie to me, but I hope it's fixable. OSARA: Move to next chord and OSARA: Move to previous chord do not work when a filter with the 'Show only events that pass filter' option enabled is active. This likely affects the command 'and add to selection' variants as well. Checking that option in the filter dialog causes Osara to get stuck and instead of navigating between the filtered notes when pressing the left and right arrows, event navigation gets completely broken and Osara only reports things like the following: "bar 4 beat 4 99% 252 notes bar 1 beat 1 0% 186 notes"

If you filter all note events out completely, something similar happens. Furthermore, this behavior seems to have an impact on the Osara 'move to note in chord' commands, because pressing up/down results in Osara reporting 'C-1' (although no C-1 note gets actually selected) - as it shouldn't.

ScottChesworth commented 2 years ago

Perhaps either @RDMurray or @leonardder can take a look into this if they have time? Gonna label it as high priority because it's tripped people up across the support groups a fair few times now.

LeonarddeR commented 2 years ago

I'm confused. I'd say we just use REAPER api's to iterate through notes, so we somehow get different information when filtering.

LeonarddeR commented 2 years ago

I looked into this and it seems that technically, filtering is taken into account when calling MIDI_GetNote, but not when calling MIDI_CountEvts. Therefore the number of counted events is much higher than it should be, and therefore OSARA reports this extraneous numbers at one position. The reason why these ghost notes are reported at random places might have to do with another technical thing, namely that we use C++ equal_range function that expects notes to be ordered by position. I'll see what we can do about this.

LeonarddeR commented 2 years ago

This requires a fix from Cockos. I'll see whether I can contact them.