Skip to content
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

Add feedback for MIDI event mute/unmute #1188

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MatejGolian
Copy link
Contributor

I wanted to add feedback when muting/unmuting MIDI events. The reported message should depend on the selection (notes vs CCs vs both). The basic logic seems to work, but I can't figure out how to count muted CCs, because a method completely analogous to how it's done with notes is clearly not possible - at least that's my impression.
@jcsteh could you take a look and perhaps even fix the problem? I think it would take far less time for you to fix it than explain to me what the problem is, but of course I'm not opposed to fixing it myself - I just don't know how.
Many thanks...

@jcsteh
Copy link
Owner

jcsteh commented Jan 11, 2025

Thanks for your work. Just FYI, I'm about to go away on holiday for a couple of weeks, so I likely won't be able to look at this until the end of January at the very earliest.

@MatejGolian
Copy link
Contributor Author

I understand. Have a nice holiday then.

@MatejGolian
Copy link
Contributor Author

BTW I have a vague understanding of why it isn't working, but of course not on a level that would help me come up with a solution.
I have a variable called selectedCCs which is a vector. Now when its size is 1 my goal would be to get the 1st CC and check if its muted. The problem is that if I just use something like
auto cc = selectedCCs[0];
or
auto cc = selectedCCs.begin(); ,
checking the value of cc.muted does not work as I would have expected.
On the other hand
auto cc = findCC(take, 0);
returns an object which works, but doing it this way is probably not optimal. So the thing is that I don't get the difference between the objects returned in each scenario.
Next this is the line responsible for counting the total number of muted CCs, but it uses the begin() and end() methods and probably that's the reason for it not working.
int mutedCount = count_if(selectedCCs.begin(), selectedCCs.end(), [](auto cc) { return cc.muted; });
So hopefully it's not a big issue, but it's not something I'm able to figure out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants