Old 07-02-2022, 09:17 AM   #1
Navelpluisje
Human being with feelings
 
Navelpluisje's Avatar
 
Join Date: Mar 2020
Location: IJsselstein, Netherlands
Posts: 435
Default Get/Set value in `MIDI CC/OSC only` actions

In the REAPER action list are action which are `MIDI
CC/OSC only` like actionId 999. Is there a way to retreive and set the value in these actions?
__________________
Created ReaSonus FaderPort: Documentation and Download from Github. Report Issues
Created Reapinger BCF2000: Documentation and Download from Reaper Stash
Donations: Buy me a coffee or beer or buy one of my shirts in Europe or North America
Navelpluisje is offline   Reply With Quote
Old 07-02-2022, 09:45 PM   #2
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,776
Default

The Midi CC value is set by the incoming Midi message (on the Reaper Control Path i.e. fed by a Midi device with "Control" checked and by plugins like "MidiToReaConntrolPath" or "ReaLearn" or by directly using the "Send Midi" Reaper API in a script).

I found that the Midi value can be retrieved by an appropriate API call " get_action_context(#filename,sectionID,cmdID,mode, resolution,val); ", but OSC values can't be retrieve. Hence setting the value does not make sense.

I hope for improvement on that behalf, but I did not find anything yet.

OTOH ReaPack:ReaLearn seems to be able to receive and decode OSC messages properly.

-Michael

Last edited by mschnell; 07-03-2022 at 01:47 AM.
mschnell is offline   Reply With Quote
Old 07-03-2022, 07:18 AM   #3
helgoboss
Human being with feelings
 
helgoboss's Avatar
 
Join Date: Aug 2010
Location: Germany
Posts: 2,199
Default

Quote:
Originally Posted by Navelpluisje View Post
In the REAPER action list are action which are `MIDI
CC/OSC only` like actionId 999. Is there a way to retreive and set the value in these actions?
Set value: Yes, but only as "normalized" 7-bit or 14-bit MIDI value, see KBD_OnMainActionEx. E.g. you can't pass dB for metronome volume.

Get value: I wish there would, but I'm pretty sure there's no such way ATM. An action in REAPER just doesn't have the concept of "a current value". The exception are toggle actions, which can report their on/off state. But there's no such thing for reporting e.g. a floating point value.

ReaLearn maintains current values for action targets to have at least some pseudo feedback, but of course it falls short in some ways.
helgoboss is online now   Reply With Quote
Old 07-11-2022, 03:42 AM   #4
Navelpluisje
Human being with feelings
 
Navelpluisje's Avatar
 
Join Date: Mar 2020
Location: IJsselstein, Netherlands
Posts: 435
Default

Thanx for the replies. Will try them
__________________
Created ReaSonus FaderPort: Documentation and Download from Github. Report Issues
Created Reapinger BCF2000: Documentation and Download from Reaper Stash
Donations: Buy me a coffee or beer or buy one of my shirts in Europe or North America
Navelpluisje is offline   Reply With Quote
Old 07-11-2022, 07:09 AM   #5
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,108
Default

Not a general answer, but for getting current metronome volume (action 999):
https://forum.cockos.com/showthread....54#post1948654

edit: needs SWS extension
nofish is offline   Reply With Quote
Old 07-11-2022, 07:15 AM   #6
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,108
Default

Quote:
Originally Posted by helgoboss View Post
Get value: I wish there would, but I'm pretty sure there's no such way ATM.
Should also be possible (normalized) with get_action_context() as mschnell wrote, no?

edit:
Ok, that's for scripts only it seems, maybe of no use for ReaLearn(?).
nofish is offline   Reply With Quote
Old 07-11-2022, 01:43 PM   #7
helgoboss
Human being with feelings
 
helgoboss's Avatar
 
Join Date: Aug 2010
Location: Germany
Posts: 2,199
Default

Quote:
Originally Posted by nofish View Post
Should also be possible (normalized) with get_action_context() as mschnell wrote, no?

edit:
Ok, that's for scripts only it seems, maybe of no use for ReaLearn(?).
Yes, only accessible to the script being invoked. Even more important: The value doesn't represent the value of the thing being controlled but the incoming value (the MIDI CC) ... so not usable.
helgoboss is online now   Reply With Quote
Old 07-11-2022, 02:10 PM   #8
Navelpluisje
Human being with feelings
 
Navelpluisje's Avatar
 
Join Date: Mar 2020
Location: IJsselstein, Netherlands
Posts: 435
Default

Quote:
Originally Posted by nofish View Post
Not a general answer, but for getting current metronome volume (action 999):
https://forum.cockos.com/showthread....54#post1948654

edit: needs SWS extension
Thanx, this is working as I expected and hoped.
__________________
Created ReaSonus FaderPort: Documentation and Download from Github. Report Issues
Created Reapinger BCF2000: Documentation and Download from Reaper Stash
Donations: Buy me a coffee or beer or buy one of my shirts in Europe or North America
Navelpluisje is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.