Old 07-03-2019, 10:16 AM   #1
rrabien
Human being with feelings
 
Join Date: Aug 2017
Posts: 8
Default Is there any way to ping Reaper via OSC?

Is there any way to ping Reaper via OSC do see if its running and the UDP communications are setup correctly.

After my app starts up, I want to request all the parameters from Reaper via /action/41743. However if Reaper isn't running yet, or not configured, the message is lost. So I send the message on a timer until I get a response from Reaper.

However, if Reaper is just busy, it gets the message but doesn't respond and the messages back up. Then it responds to the action 10 - 20 times, dumping a huge amount of parameters.

What I'd like to do is ping reaper, until I get a ping response and then request all the parameters. There is no ping osc message. Is there something I could send instead? An OSC message that will generate a response and not change the state of the users session?
rrabien is offline   Reply With Quote
Old 07-03-2019, 01:42 PM   #2
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

Ping is an ICMP protocol and not transferred to any application, but handled by the TCP/IP stack.

OSC is a USP protocol working between applications. So there is no interconnection between theses at all.

-Michael
mschnell is offline   Reply With Quote
Old 07-03-2019, 01:47 PM   #3
rrabien
Human being with feelings
 
Join Date: Aug 2017
Posts: 8
Default

I didn't mean a literal ICMP ping, but something at the OSC protocol level that is similar. I'm looking for a command that I can send that will generate a response without affecting state.
rrabien is offline   Reply With Quote
Old 07-09-2019, 03:05 PM   #4
netphreak
Human being with feelings
 
Join Date: Apr 2019
Posts: 98
Default

It seems like all of us trying to play around with OSC meets the same really basic shortcoming - no way to do simple queries, only feedback on alter Absurd...

Would love it if someone prove me wrong...
netphreak is offline   Reply With Quote
Old 07-09-2019, 09:44 PM   #5
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,690
Default

I did not do anything using the OSC interface of Reaper's, yet.

I use "OSCIIBot" to exchange OSC messages with a Behringer XR18 (and on the other end by Midi via Reaper with an XControl Compact that also controls the parameters of my Live keyboard Setup in Reaper). The XR18 does send out any parameter settings via OSC on request from an appropriate OSC message.

I did suppose that Reaper would do something similar, but in effect, OSC only defines the protocol frame and not the protocol content, and any OSC site is free to define it's own messages and communication. Hence there should be some documentation for this.

-Michael

Last edited by mschnell; 07-10-2019 at 05:59 AM.
mschnell is offline   Reply With Quote
Old 07-10-2019, 02:43 AM   #6
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 92
Default

Quote:
Originally Posted by netphreak View Post
It seems like all of us trying to play around with OSC meets the same really basic shortcoming - no way to do simple queries, only feedback on alter Absurd...

Would love it if someone prove me wrong...
Not me, I see no use case for querying the state of a single parameter.
For getting the state of the FX parameters use one of these:
Code:
DEVICE_FX_SELECT i/device/fx/select t/device/fx/select/@
DEVICE_PREV_FX t/device/fx/-
DEVICE_NEXT_FX t/device/fx/+
For the track parameters use:
Code:
DEVICE_TRACK_SELECT i/device/track/select t/device/track/select/@ 
DEVICE_PREV_TRACK t/device/track/-
DEVICE_NEXT_TRACK t/device/track/+
Reaper will send the parameter values for the FX/track. I use this approach for my OSC controller and it's working just fine.

As for queries, I would like to have the ability to query the FX/track parameters by name or id (all parameters of an FX or track at once).
Gerrit is offline   Reply With Quote
Old 07-12-2019, 01:36 PM   #7
TabbyCat
Human being with feelings
 
TabbyCat's Avatar
 
Join Date: May 2019
Location: Los Angeles, CA
Posts: 161
Default

Quote:
Originally Posted by Gerrit View Post
Not me, I see no use case for querying the state of a single parameter.
For getting the state of the FX parameters use one of these:
Code:
DEVICE_FX_SELECT i/device/fx/select t/device/fx/select/@
DEVICE_PREV_FX t/device/fx/-
DEVICE_NEXT_FX t/device/fx/+
Thanks for this - I was doing "refresh controller" (/action/41743) which dumps everything, and I was filtering it out on the client side. This is more succinct!
TabbyCat is offline   Reply With Quote
Old 07-12-2019, 02:33 PM   #8
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 92
Default

Quote:
Originally Posted by TabbyCat View Post
Thanks for this - I was doing "refresh controller" (/action/41743) which dumps everything, and I was filtering it out on the client side. This is more succinct!
Keep in mind that the number of parameters sent (FX param bank size) is determined by this setting:
Code:
DEVICE_FX_PARAM_COUNT 48
The bank select messages are used to switch banks:
Code:
DEVICE_FX_PARAM_BANK_SELECT i/device/fxparam/bank/select t/device/fxparam/bank/select/@ 
DEVICE_FX_PARAM_BANK_SELECT s/device/fxparam/bank/str
DEVICE_PREV_FX_PARAM_BANK t/device/fxparam/bank/-
DEVICE_NEXT_FX_PARAM_BANK t/device/fxparam/bank/+
Parameters are addressed by index within a bank. This works fine if your controller acts on one bank at a time, but if, for example, you want to control the first and fifteenth parameter of a plugin the bank size needs to be at least 15 even if the controller can only display four parameters at once.
This works the same for tracks and banks of tracks.
Gerrit is offline   Reply With Quote
Old 07-12-2019, 07:31 PM   #9
TabbyCat
Human being with feelings
 
TabbyCat's Avatar
 
Join Date: May 2019
Location: Los Angeles, CA
Posts: 161
Default

Totally - I've been suffering through that fact, detailed in this thread:

https://forum.cockos.com/showthread.php?t=222879

The main thing is that it never occurred I could explicitly select the object in question by number, instead of dumping the whole session.

Last edited by TabbyCat; 07-12-2019 at 07:31 PM. Reason: link inactive
TabbyCat is offline   Reply With Quote
Old 07-13-2019, 12:34 AM   #10
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 92
Default

Quote:
Originally Posted by TabbyCat View Post
Totally - I've been suffering through that fact, detailed in this thread:

https://forum.cockos.com/showthread.php?t=222879

The main thing is that it never occurred I could explicitly select the object in question by number, instead of dumping the whole session.
I use an array of structs to store the parameters:
Code:
struct oscParameter{
  char  name[NAME_LENGTH+1];                          // parameter long name
  int   number;                                       // parameter number
  char  valueStr[VALUE_LENGTH];                       // formatted string value e.g. '350Hz'
  float value;                                        // normalised value
};
typedef struct oscParameter OscParameter;
The approach is similar, get all the parameters I need and go through the banks on the client, my controller can display 16 parameters at once. This is done so I can assign a foot pedal to a parameter and it will keep working even when selecting another plugin and or track on the controller so long as no tracks are inserted before the track and no plugins are inserted on the track before the plugin in question.
As I don't use the controller for instrument plugins, just effects, getting 48 parameters is enough for my purpose.
Gerrit is offline   Reply With Quote
Old 07-13-2019, 02:23 AM   #11
netphreak
Human being with feelings
 
Join Date: Apr 2019
Posts: 98
Default

Quote:
Originally Posted by Gerrit View Post
Not me, I see no use case for querying the state of a single parameter.
Well, compare it to a database with lots of data, and there's no way to query it because the designers forgot the "SELECT" statement. Only dump, with some options to limit the dump. To most programmers, that's not a very useful database engine...
netphreak is offline   Reply With Quote
Old 07-13-2019, 03:39 AM   #12
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 92
Default

Quote:
Originally Posted by netphreak View Post
Well, compare it to a database with lots of data, and there's no way to query it because the designers forgot the "SELECT" statement. Only dump, with some options to limit the dump. To most programmers, that's not a very useful database engine...
It's not a database, it's a messaging interface on a DAW so the comparison is irrelevant.
Again, what's the use case for querying (down to the level of) a single parameter? Please don't say "it's more flexible" without stating explicitly why this flexibility is required. What problem does it solve?
Gerrit is offline   Reply With Quote
Old 07-13-2019, 04:04 AM   #13
netphreak
Human being with feelings
 
Join Date: Apr 2019
Posts: 98
Default

I know it's not a database, but nonetheless I find it peculiar there's no way of asking "what's your value" WITHOUT altering the actual value first...

Unless I have misunderstood completely here, the ONLY way to get values without altering anything is by sending /action/41743. The ONLY way to limit the overwhelming response is adjusting the *.ReaperOSC file.

Because of my (and I'm sure I'm not alone) lack of knowledge and the rather sparse OSC/Reaper documentation the progress of creating a well functional ReaperOSC is a time consuming and frustrating progress in the dark. When you have a ReaperOSC working close to what you could hope for, the work on filtering the results on client side (low powered micro controller like Arduino maybe?) remains.

Gerrit - you have proved there's no NEED to query a single value over OSC. But it's a long and steep road for most of us to get there. Few will succeed. If one COULD query single values, many would be able to make great hardware boxes for controlling Reaper the way they wish.
netphreak is offline   Reply With Quote
Old 07-13-2019, 04:51 AM   #14
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 92
Default

Quote:
Originally Posted by netphreak View Post
I know it's not a database, but nonetheless I find it peculiar there's no way of asking "what's your value" WITHOUT altering the actual value first...

Unless I have misunderstood completely here, the ONLY way to get values without altering anything is by sending /action/41743. The ONLY way to limit the overwhelming response is adjusting the *.ReaperOSC file.

Because of my (and I'm sure I'm not alone) lack of knowledge and the rather sparse OSC/Reaper documentation the progress of creating a well functional ReaperOSC is a time consuming and frustrating progress in the dark. When you have a ReaperOSC working close to what you could hope for, the work on filtering the results on client side (low powered micro controller like Arduino maybe?) remains.

Gerrit - you have proved there's no NEED to query a single value over OSC. But it's a long and steep road for most of us to get there. Few will succeed. If one COULD query single values, many would be able to make great hardware boxes for controlling Reaper the way they wish.
The refresh all control surfaces is not the only way to get the state of the parameters, this action is intended for use on startup of the controller. Selecting a track for editing on the controller will result in Reaper sending all data for that track, same with FX plugins and or instruments, selecting a plugin will result in Reaper sending the parameters for the plugin. As mentioned above the bank size will determine the number of parameters sent. Similar the track count will determine the number of tracks sent when triggering the refresh all surfaces action or when selecting another bank of tracks.
The problem with queries is that you need to know what to query, a name perhaps or preferably a truly unique id, but whatever the approach your controller now needs to have knowledge about stuff in the DAW. This offers new possibilities but also adds complexity and it's not at all certain it will make building controllers easier.
This part from the config file contains the device messages that will result in Reaper sending data:
Code:
DEVICE_TRACK_SELECT i/device/track/select t/device/track/select/@ 
DEVICE_PREV_TRACK t/device/track/-
DEVICE_NEXT_TRACK t/device/track/+

DEVICE_TRACK_BANK_SELECT i/device/track/bank/select t/device/track/bank/select/@
DEVICE_PREV_TRACK_BANK t/device/track/bank/-
DEVICE_NEXT_TRACK_BANK t/device/track/bank/+

DEVICE_FX_SELECT i/device/fx/select t/device/fx/select/@
DEVICE_PREV_FX t/device/fx/-
DEVICE_NEXT_FX t/device/fx/+

DEVICE_FX_PARAM_BANK_SELECT i/device/fxparam/bank/select t/device/fxparam/bank/select/@ 
DEVICE_FX_PARAM_BANK_SELECT s/device/fxparam/bank/str
DEVICE_PREV_FX_PARAM_BANK t/device/fxparam/bank/-
DEVICE_NEXT_FX_PARAM_BANK t/device/fxparam/bank/+

DEVICE_FX_INST_PARAM_BANK_SELECT i/device/fxinstparam/bank/select t/device/fxinstparam/bank/select/@
DEVICE_FX_INST_PARAM_BANK_SELECT s/device/fxinstparam/bank/str
DEVICE_PREV_FX_INST_PARAM_BANK t/device/fxinstparam/bank/-
DEVICE_NEXT_FX_INST_PARAM_BANK t/device/fxinstparam/bank/+
I agree that the documentation could be improved, the OSC config file does contain the dictionary so to speak but there's nothing on what kind of conversations are possible.
Gerrit is offline   Reply With Quote
Old 07-13-2019, 06:03 AM   #15
netphreak
Human being with feelings
 
Join Date: Apr 2019
Posts: 98
Default

Quote:
Originally Posted by Gerrit View Post
The refresh all control surfaces is not the only way to get the state of the parameters, this action is intended for use on startup of the controller. Selecting a track for editing on the controller will result in Reaper sending all data for that track, same with FX plugins and or instruments, selecting a plugin will result in Reaper sending the parameters for the plugin.
I know I sound like a complete beginner for asking, but I was not aware of this. By changing the:
Code:
DEVICE_TRACK_FOLLOWS DEVICE
to
Code:
DEVICE_TRACK_FOLLOWS LAST_TOUCHED
I indeed get a response in OSC when selecting track in Reaper software, but no response when sending OSC message:
Code:
/track/2/select f 1
What do you mean by "Selecting a track for editing on the controller"?
netphreak is offline   Reply With Quote
Old 07-13-2019, 06:59 AM   #16
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 92
Default

Quote:
Originally Posted by netphreak View Post
I know I sound like a complete beginner for asking, but I was not aware of this. By changing the:
Code:
DEVICE_TRACK_FOLLOWS DEVICE
to
Code:
DEVICE_TRACK_FOLLOWS LAST_TOUCHED
I indeed get a response in OSC when selecting track in Reaper software, but no response when sending OSC message:
Code:
/track/2/select f 1
What do you mean by "Selecting a track for editing on the controller"?
Selecting a track using the device messages:
Code:
DEVICE_TRACK_SELECT i/device/track/select t/device/track/select/@ 
DEVICE_PREV_TRACK t/device/track/-
DEVICE_NEXT_TRACK t/device/track/+
Try sending something like
Code:
device/track/select i 1
I didn't study the interplay between the Reaper follows setting, the device follows setting and the responses by Reaper. You may need to leave the setting
Code:
DEVICE_TRACK_FOLLOWS DEVICE
as is.
My controller is intended for use away from the computer monitor so in my case the device always follows the device.
Gerrit is offline   Reply With Quote
Old 07-13-2019, 07:10 AM   #17
netphreak
Human being with feelings
 
Join Date: Apr 2019
Posts: 98
Default

Code:
device/track/select i 1
Doesn't do anything it seems, no response in Reaper or OSC listener...
netphreak is offline   Reply With Quote
Old 07-13-2019, 07:24 AM   #18
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 92
Default

Quote:
Originally Posted by netphreak View Post
Code:
device/track/select i 1
Doesn't do anything it seems, no response in Reaper or OSC listener...
It works for me with these settings:
Code:
REAPER_TRACK_FOLLOWS REAPER
DEVICE_TRACK_FOLLOWS DEVICE
DEVICE_TRACK_BANK_FOLLOWS DEVICE
DEVICE_FX_FOLLOWS DEVICE
Try these settings to check if Reaper will respond to the track select:
Code:
REAPER_TRACK_FOLLOWS DEVICE
DEVICE_TRACK_FOLLOWS DEVICE
DEVICE_TRACK_BANK_FOLLOWS DEVICE
DEVICE_FX_FOLLOWS DEVICE
Sending track select messages should now change the selected track in Reaper.
Gerrit is offline   Reply With Quote
Old 07-13-2019, 08:19 AM   #19
netphreak
Human being with feelings
 
Join Date: Apr 2019
Posts: 98
Default

When setting all to "DEVICE" as suggested, tracks are changed with "device/track/select i 1" - but response is only feedback informing that a new track is selected - no other track values...

For this test I use the default ReaperOSC file, to make sure there's no other funny stuff going on. Weird!
netphreak is offline   Reply With Quote
Old 07-13-2019, 11:13 AM   #20
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 92
Default

Quote:
Originally Posted by netphreak View Post
When setting all to "DEVICE" as suggested, tracks are changed with "device/track/select i 1" - but response is only feedback informing that a new track is selected - no other track values...

For this test I use the default ReaperOSC file, to make sure there's no other funny stuff going on. Weird!
Hmm, haven't got an immediate answer for you.
Be aware that feedback for the selected track is provided through track messages e.g. 'track/volume/str', not through indexed track messages e.g. 'track/@/volume/str'
Gerrit is offline   Reply With Quote
Old 07-13-2019, 11:33 AM   #21
TabbyCat
Human being with feelings
 
TabbyCat's Avatar
 
Join Date: May 2019
Location: Los Angeles, CA
Posts: 161
Default

Quote:
Originally Posted by netphreak View Post
When setting all to "DEVICE" as suggested, tracks are changed with "device/track/select i 1" - but response is only feedback informing that a new track is selected - no other track values...
I have found that in situations like this, Reaper tries to be too "smart" about it, and only sends child data that has explicitly changed since the last interaction. I understand that we are talking about network traffic, and the best practice is to limit the depth of the stream, but I agree with the OP: there are times you want to force Reaper to resend data because conditions have changed on the client side.

E.g. if the state/function of controls in the client changes, you might need to forcefully repopulate those controls. Currently the only way to do that is to 1) create complex data structures and do all the state management yourself; or 2) create "kludges" where you e.g. send a select command to a completely unrelated object, then re-select the original object in order to force an update.

In my mind, sending:
Code:
device/track/select i 1
...should echo all the data attached to Track 1, whether or not the selected track and its underlying data has actually changed.
TabbyCat is offline   Reply With Quote
Old 07-14-2019, 01:40 AM   #22
netphreak
Human being with feelings
 
Join Date: Apr 2019
Posts: 98
Default

I am really stuck - have a look at this:

I send
Code:
/device/track/select i 1
from the client, and somehow it's translated to
Code:
/track/1/select
Could there be a bug in recent version of Reaper? I use last one, can anyone confirm this is working and what Reaper version running?
netphreak is offline   Reply With Quote
Old 07-14-2019, 02:01 AM   #23
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 92
Default

Quote:
Originally Posted by netphreak View Post
I am really stuck - have a look at this:

I send
Code:
/device/track/select i 1
from the client, and somehow it's translated to
Code:
/track/1/select
Could there be a bug in recent version of Reaper? I use last one, can anyone confirm this is working and what Reaper version running?
Just updated Reaper to 5.980 on Mac and it's working fine. Sending track select and FX select from my controller and this is what the listen window in Reaper is showing:
Code:
/device/track/select [i] 10 
/device/fx/select [i] 1
Behaviour is also correct, track and FX data are sent by Reaper.
Gerrit is offline   Reply With Quote
Old 07-14-2019, 02:29 AM   #24
netphreak
Human being with feelings
 
Join Date: Apr 2019
Posts: 98
Default

I'm on Windows x64, but I guess there's no bug in the Windows version either then... Gerrit, would you mind sending me the complete ReaperOSC file you are using?
netphreak is offline   Reply With Quote
Old 07-14-2019, 02:39 AM   #25
Gerrit
Human being with feelings
 
Join Date: Aug 2018
Location: Maastricht
Posts: 92
Default

Quote:
Originally Posted by netphreak View Post
I'm on Windows x64, but I guess there's no bug in the Windows version either then... Gerrit, would you mind sending me the complete ReaperOSC file you are using?
This is the configuration I use with my latest controller as used for the example above:
ZeusROC.ReaperOSC

Mind you that Reaper sending this message as a response:
Code:
TRACK_SELECT b/track/select b/track/@/select
is to be expected, this is Reaper giving feedback. This message is used because more then one track can be selected in Reaper.
Gerrit is offline   Reply With Quote
Old 07-14-2019, 02:52 AM   #26
netphreak
Human being with feelings
 
Join Date: Apr 2019
Posts: 98
Default

Thank you, /device/*** commands not working with that ReaperOSC file either.

Will find another HDD and install a fresh version of Windows 10 and Reaper 5.980 tonight.
netphreak is offline   Reply With Quote
Old 07-14-2019, 09:19 AM   #27
netphreak
Human being with feelings
 
Join Date: Apr 2019
Posts: 98
Default

I found the reason why I had such problems.

When setting up OSC in Reaper, you have several options:

I set up one OSC connection with mode: "Device IP/port", and named it "Receive". And another one with mode: "Local port" named "Send".

This gives the behavior I experienced. It works, but not fully! When deleting the two connections, and made a single one with mode: "Configure device IP+local port" it works as expected.

If this is a bug or a "feature" I don't know, but if it's intentional from the developers of Reaper I wonder what they where thinking...

Sorry for hijacking this thread rrabien, but maybe some of it is useful for "pinging" Reaper in another way
netphreak 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 03:30 AM.


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