Old 10-15-2020, 03:56 AM   #1
Florian.S
Human being with feelings
 
Florian.S's Avatar
 
Join Date: Jul 2020
Location: Ger
Posts: 8
Default Passing OSC Value to ReaScript

Hallo,

is there a way to pass a OSC Value into a ReaScript?

Following behavior is desired:

Triggering a script via "/action/str _RSaadca421ec7e271597f22b259716fbbd2dc74b98" works for triggering the Script.

Now i want so send "/action/str _RSaadca421ec7e271597f22b259716fbbd2dc74b98 1.0"
_RSaadca421ec7e271597f22b259716fbbd2dc74b98 is send as a string
1.0 is send as a float

If it is possible it would be easy to move markers or trigger different behaviors of a script via Osc Input values.

It is said that you can retrieve MIDI/OSC/mouse-wheel/trackpad input values when the script is bound to MIDI/OSC controllers.

Can somebody guide me how to use this?
Florian.S is offline   Reply With Quote
Old 10-15-2020, 05:15 AM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,092
Default

There is no way to get OSC-messages in ReaScript.

However, by using the reaper.OscLocalMessageToHost-function, you can send a local (means Reaper-internally-only) OSC-message with an optional 14-bit-value-parameter, which can be read by the function reaper.get_action_context.

Maybe you can find a way to trigger that behavior from OSC to at least be able to send a value that is seen by reaper.get_action_context()...

Apart from that, I haven't seen anything yet.

Edit:
I made a FR for that
https://forum.cockos.com/showthread....78#post2353178
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1385 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish

Last edited by Meo-Ada Mespotine; 10-15-2020 at 05:23 AM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-15-2020, 06:11 AM   #3
Florian.S
Human being with feelings
 
Florian.S's Avatar
 
Join Date: Jul 2020
Location: Ger
Posts: 8
Default

Thanks,

i will toy around with this. Maybe i can work something out.

Getting OSC values into scripts would be a really powerful function.
Is it possible to get info out of a midi command? If this is possible converting osc to midi would be a way around.
Florian.S is offline   Reply With Quote
Old 10-16-2020, 02:49 AM   #4
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 10,193
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
There is no way to get OSC-messages in ReaScript.
Seems like an involuntary shortcoming or a bug, as this does work fine with ControlPath Messages derived from Midi messages.
Hence ControlPath Messages derived from OSC messages should work exactly the same.

-Michael

Last edited by mschnell; 10-17-2020 at 10:44 PM.
mschnell is online now   Reply With Quote
Old 10-20-2020, 01:59 PM   #5
pljones
Human being with feelings
 
pljones's Avatar
 
Join Date: Aug 2007
Location: London, UK
Posts: 743
Default

I replied to your other post but I'll mention it here as well.

There's more in https://forum.cockos.com/showthread.php?t=202734 but essentially...
Code:
  -- the only way to get info from the OSC input trigger... ugh, ugh, ugh...
  -- but it works more or less
  local tkNo = name:match([[toggleTrackEnable(%d*)%.lua$]])
  if (tkNo == nil) then
    return
  end
__________________
Quote:
Originally Posted by Tony Williams
...Playing fast around the drums is one thing. But to play with people for others, to listen to, that's something else. That's a whole other world.
pljones 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 08:52 AM.


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