get_action_context() desperately needs to return:
- the MIDI event value that was bound to the action (e.g. CC or note number)
- the MIDI channel of the event
- the full OSC message string
The basic reason is to improve script/action reusability.
One specific use-case: with
Reaticulate, one can activate up to 128 articulations on 16 channels. I have an action "activate articulation by CC" which allows you to bind a CC to that action and activate an articulation based on the CC.
Because get_action_context() doesn't return the MIDI channel of the triggering event, I need to have 16 separate such actions (activate on channel 1, channel 2, ..., 16). Although still annoying and spammy, this isn't the end of the world when you're talking about 16 variants of all the applicable actions, and there's certainly enough precedent within Reaper's native actions.
However, users are asking to be able to activate articulations by note events or program change events. Now I have a problem: because get_action_context() doesn't tell me the note/program number, I would need to create 128*16=2048 individual Reaper actions to solve this (128 actions for each of the 128 programs times 16 channels). I
could do it theoretically, but I would be inundating the user's action list with Reaticulate actions.
If get_action_context() returned the note/program number as well as the source channel, all I'd need is one action "Activate articulation by MIDI event" and the user could bind the CC, plus all relevant notes and program changes on all channels to a single action.
Tedious for the user to set up (though not nearly as tedious as having separate actions), but at least I'm avoiding the explosion of discrete actions spamming the user's action list.