jcsteh / osara

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

MIDI Editor: Add Support for Named Notes #183

Closed MatejGolian closed 5 years ago

MatejGolian commented 5 years ago

Hello, I'm not sure if the current REAPER API allows implementing this or not, but it would be useful if support for reading note names could be added to Osara. Currently loading note names from a file does not make any difference - Osara doesn't report the imported note names not even if one switches to the Named notes mode. If my understanding of how this works is correct, custom note names (for example imported from note name maps) should be visible when switched to the Named notes view. I don't know how sighted people see it, but I think that it would be ideal if note names also appeared inside the event properties dialog. As far as I understand, the event properties dialog does not change no matter the mode and so this might be an all or nothing situation in a sense, because it could presumably result in the note names being there even in the editor modes that don't make use of them, but having the note names there is rather crucial in case of drum editing - it being probably the most common reason why'd one want to use named notes in the first place.

jcsteh commented 5 years ago

OSARA can't (and shouldn't) affect the Event Properties dialog. That is a feature request you should submit to Cockos; it isn't accessibility specific and doesn't require any input from me.

I'm not sure whether it's possible to do this in the actual MIDI view; I'll have to take a look at the API again.

MatejGolian commented 5 years ago

I see. Thank you for taking a look at it. So, if I get it correctly, this is something that has to be likely done on the REAPER side of things, right? I don't understand the technicalities, but what would be the best thing to request provided that there aren't any API functions for retrieving note names? Perhaps the most intuitive thing would be if REAPER did everything automatically, that is to say, if the existing API functions would be modified as such that they would return note names in the named notes view and note pitches in every other MIDI editor view. If a particular note would be unnamed, the note's pitch could be reported as fallback. If it was possible to do it like this, the good thing would be that Osara wouldn't need to be modified in any way. Or would having separate functions for retrieving note names be better? It's up to Cockos of course, but it would be good to know what you think so that we can file the best request possible if needed.

MatejGolian commented 5 years ago

I have discovered another issue with how Osara reports note names. I didn't want to open a new issue as I think that it's related to the exact same REAPER API functions. So, I don't believe that this is an Osara issue, but I don't know what exactly to pitch to Cockos. In Preferences > Media > MIDI there is a setting called "MIDI octave name display offset". It does exactly what you'd expect - it changes how MIDI notes are displayed. The problem is that this setting only seems to affect the event properties dialog - no matter what you set this option to, outside of the event properties dialog Osara always reports the values as if MIDI octave name display offset was set to 0. Obviously, the thing concerning my original issue takes precedence over this and I guess that this second issue won't become a priority for Cockos, but it would still be nice if this got addressed at some point for consistency reasons. @ScottChesworth would you be so kind and phrase these things to Cockos once we know what exactly should be done?

ScottChesworth commented 5 years ago

Yeah @MatejGolian , always happy to take stuff to the forum here. I'll be keeping an eye on this thread and will write to them once @jcsteh has taken a look into possibilities.

MatejGolian commented 5 years ago

Thanks, @ScottChesworth. :-) If this is indeed more of a REAPER thing than an Osara one, I wonder how Cockos/Justin will respond to it. If my notion is correct there's a keyboard displayed in at least some of the MIDI views and if I got it correctly the note names actually show up on the keys of that keyboard and not in the area where the actual MIDI events are. Of course, this may not be a problem - I just hope that it won't interfere with the experience of sighted folks some how. Probably it wouldn't do so, but one never knows.

jcsteh commented 5 years ago

There seems to be some confusion here. To be clear, I said that anything related to the Event Properties dialog should be immediately taken to Cockos. You don't need any input from me on that. If the properties dialog doesn't honour note names, that's exactly what you ask to be fixed. If there's a request to be made here, you can go do that now; it should be considered separate from the other issue.

I'm not sure about the note names in the actual editor view. Right now, the names OSARA uses are hard coded. I'm not sure whether it's possible for me to access the proper names via the API. From what I recall, it isn't, but it's possible I missed something. I'll have to take a look when I get some time.

ScottChesworth commented 5 years ago

Cheers @jcsteh , that clarifies things. I'll take a poke at the Event Properties dialog and write something up soon.

MatejGolian commented 5 years ago

Thanks for the response, Jamie. I understood the part about the event properties dialog - perhaps I didn't express myself well enough. In my previous 2 comments I was asking about the editor view (I was only pointing out the differences in behavior between it and the event properties dialog). Since you say that Osara uses hard coded values for the editor view, assuming that there really aren't any API functions for retrieving note names at present, requesting the addition of such functions to the API seems to be the next logical step in my opinion. And the fact that Osara uses hard coded values in editor view of course also explains why offsetting the MIDI octave name display in preferences makes no difference in how Osara reports things, which in turn means that there's no problem here. So, the 2 feature REQUESTS to Cockos should be something like:

  1. Add API functions for retrieving note names of MIDI events
    • In the named notes view custom note names should be reported if available; in views that don't support custom note names note pitches should be returned.
    • The returned values should take the MIDI octave name display offset setting into account.
  2. Display note names in the event properties dialog if in the named notes view @ScottChesworth, thanks again for your help. These are 2 separate things and the event properties dialog one is not really an accessibility thing in the strict sense of the word, but they are linked and so, could you possibly mention both of them to Cockos?
jcsteh commented 5 years ago

There is no point in mentioning the API bit until we confirm whether the API has this functionality or not. These are separate requests and should e considered as such. There is no reason to delay the Event Properties request.

ScottChesworth commented 5 years ago

Event Properties bug report is posted here: https://forum.cockos.com/showthread.php?p=2069580#post2069580

I was vague ish because it's not functionality I've ever used firsthand, but hopefully it's clear enough. Feel free to add to the thread if I missed anything.

MatejGolian commented 5 years ago

Thanks, Scott, your forum sums up the issue very clearly and nicely.

AZSlow3 commented 5 years ago

PR is submitted, it should:

  1. use named notes (when set)
  2. use octave name display offset preference
MatejGolian commented 5 years ago

Thank you @AZSlow3, @jcsteh, @ScottChesworth for dealing with this issue. :-) Hopefully it will be useful for more people than just myself.