Old 12-30-2021, 01:36 PM   #1
GameAudioRvlzzr
Human being with feelings
 
GameAudioRvlzzr's Avatar
 
Join Date: Apr 2016
Location: Stuttgart, Germany
Posts: 217
Default OSC from Reascript to outside Reaper

Hello you fine people,

is it possible to send OSC messages to external devices
from Reascript in Lua?

Thank you,
Micha
GameAudioRvlzzr is offline   Reply With Quote
Old 12-31-2021, 04:27 AM   #2
GameAudioRvlzzr
Human being with feelings
 
GameAudioRvlzzr's Avatar
 
Join Date: Apr 2016
Location: Stuttgart, Germany
Posts: 217
Default

Is there ANY way to send custom OSC messages to outside of reaper?

Could it be that Reaper only sends a certain set of OSC messages (like play status, track selection) to the outside but doesn't let the user send his own messages (like a string)?

(I'm trying to send feedback to a Streamdeck btw)
GameAudioRvlzzr is offline   Reply With Quote
Old 12-31-2021, 04:48 AM   #3
cjewellstudios
Human being with feelings
 
Join Date: Sep 2017
Posts: 998
Default

Hi there, I was following the thread because I don't know the answer.

I suspect that the answer is no, though. I know there is a function for sending midi both out to enabled midi surfaces and into the control path or the virtual keyboard called StuffMidiMessage. I'm fairly sure the same doesn't exist for OSC though as I've looked myself.

Another thing I don't know for sure (sorry) but Realearn might be worth checking into. You should be able to send custom osc messages in the advanced section but I haven't dug into Realearn as much as I would have liked to at this point.
cjewellstudios is offline   Reply With Quote
Old 12-31-2021, 05:24 AM   #4
pljones
Human being with feelings
 
pljones's Avatar
 
Join Date: Aug 2007
Location: London, UK
Posts: 767
Default

Despite having been asked for for years, the feature still isn't available. I'm sure there are good technical reasons...

I've done "magic" like having TouchOSC send OSC messages from a button but have an LED sensitive to MIDI messages "under" it, then have the script send the appropriate MIDI message. Painful but it works.

The design of the Reaper OSC system is the .ReaperOSC file, really - pattern match the input, trigger the operation, issue the OSC message reflecting the new state.

I also use "cheats" like having
TRACK_SELECT b/track/@/onOff
in my .ReaperOSC pattern file and then selecting a track in the script -- triggering the state update and issuing the message. Then my control surface uses that message to light an LED (vaguely related to track selection but I needed to run a script as there's no "track exclusive enable apart from the following" command built in for some reason... ).
__________________
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
Old 01-01-2022, 10:06 AM   #5
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,688
Default

ANY WAY ?!?!?
AFAIU, you can generate Midi Messages by the Reaper API in a ReaScript and use ReaPack->ReaLearn to receive same and send out OSC messages.
-Michael
mschnell is offline   Reply With Quote
Old 01-02-2022, 02:21 PM   #6
GameAudioRvlzzr
Human being with feelings
 
GameAudioRvlzzr's Avatar
 
Join Date: Apr 2016
Location: Stuttgart, Germany
Posts: 217
Default

Thank you all for your help!

Quote:
Originally Posted by cjewellstudios View Post
Realearn might be worth checking into
Yes i had a look at Realearn and it does support OSC devices, but i couldn't get mine to connect. I might have to look into it again.
Also, i've read, in another thread, a comment by the Realearn dev that sending OSC strings is not supported by Reaper. I was really hoping to send strings specifically.

Quote:
Originally Posted by pljones View Post
Despite having been asked for for years, the feature still isn't available.
Mh too bad :-/ Thank you for the info.

Quote:
Originally Posted by mschnell View Post
ANY WAY ?!?!?
AFAIU, you can generate Midi Messages by the Reaper API in a ReaScript and use ReaPack->ReaLearn to receive same and send out OSC messages.
-Michael
Yes, that seems like a viable workaround. I was really hoping though to send out strings, and i think Realearn can't send strings. Certainly, Midi can't.
Also, it begs the question: If Realearn can send OSC, what do i have to do (that Realearn does right) so write code that sends OSC?
GameAudioRvlzzr is offline   Reply With Quote
Old 01-02-2022, 03:32 PM   #7
helgoboss
Human being with feelings
 
helgoboss's Avatar
 
Join Date: Aug 2010
Location: Germany
Posts: 2,185
Default

Quote:
Originally Posted by GameAudioRvlzzr View Post
Yes i had a look at Realearn and it does support OSC devices, but i couldn't get mine to connect. I might have to look into it again.
Also, i've read, in another thread, a comment by the Realearn dev that sending OSC strings is not supported by Reaper. I was really hoping to send strings specifically.
Let me quickly correct that before the rumor spreads ;-) My comment here was that ReaScripts can't be called with a string parameter. This is not related to OSC, at least not directly.

ReaLearn certainly can send string arguments to OSC devices. REAPER, too. This is not an issue.

The issue regarding REAPER is that it doesn't provide any ReaScript function that allows one to send an OSC message to an external OSC device, not even one with a number argument. I'm sure if the devs would add one, it wouldn't be a big deal at all to support strings.

The issue regarding ReaLearn is similar. It can send OSC, but only as part of its built-in feedback functionality (both text and numbers) and with the dedicated "OSC: Send message" target (numbers only at the moment) - so only for control/feedback purposes, that is in response to incoming MIDI/OSC messages and certain events in REAPER.

Although one can use scripting in certain parts of ReaLearn (control/feedback transformation, generating MIDI feedback in response to target value changes, etc.), it's not a scripting environment comparable to ReaScript. It's not a generic programming platform made for writing totally custom scripts and executing them on demand.

Quote:
Originally Posted by GameAudioRvlzzr View Post
Yes, that seems like a viable workaround. I was really hoping though to send out strings, and i think Realearn can't send strings. Certainly, Midi can't.
Also, it begs the question: If Realearn can send OSC, what do i have to do (that Realearn does right) so write code that sends OSC?
BTW, it's not impossible to send text via MIDI. ReaLearn, CSI, Klinke and all that stuff ... they all send text via MIDI sys-ex by adhering e.g. to the Mackie protocol. But you are right, for your purposes this is probably not helpful.

So much for the status quo.

Something I could do is exposing a ReaScript function from ReaLearn which lets one send arbitrary OSC messages to the OSC devices configured in ReaLearn. (ReaLearn uses its own OSC infrastructure so it doesn't work with the OSC devices which are set up in the REAPER preferences.)
helgoboss is online now   Reply With Quote
Old 01-02-2022, 05:19 PM   #8
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,688
Default

Quote:
Originally Posted by GameAudioRvlzzr View Post
If Realearn can send OSC, what do i have to do (that Realearn does right) so write code that sends OSC?
Learn EEL

In my setup (done before ReaLearn was released, I use OSCIIBot instead, connected to Reaper via LoopMidi. OSCIIBot can do anything with Midi and OSC.

-Michael

Last edited by mschnell; 01-02-2022 at 11:40 PM.
mschnell is offline   Reply With Quote
Old 01-02-2022, 05:48 PM   #9
helgoboss
Human being with feelings
 
helgoboss's Avatar
 
Join Date: Aug 2010
Location: Germany
Posts: 2,185
Default

I agree, OSCII-bot is great for OSC/MIDI routing. Only downside is that it runs outside of REAPER and is therefore not suited for calling ReaScript functions.

The best solution would clearly be if ReaScript would get a possibility of sending OSC messages.
helgoboss is online now   Reply With Quote
Old 12-17-2023, 01:50 AM   #10
Hermani
Human being with feelings
 
Join Date: Feb 2021
Posts: 28
Default

Quote:
Originally Posted by GameAudioRvlzzr View Post
Thank you all for your help!
Also, it begs the question: If Realearn can send OSC, what do i have to do (that Realearn does right) so write code that sends OSC?
Maybe I'm missing something , but you could just create a realearn mapping with source parameter1. then in reascript code change that parameter to a specific value

Code:
  calcv =  calculateValue()
  -- track , fx id pointing to realearn FX // 0  = first param
  reaper.TrackFX_SetParam(track,fxIdx,0,calcv)
Hermani is offline   Reply With Quote
Old 12-17-2023, 04:52 AM   #11
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,688
Default

Quote:
Originally Posted by helgoboss View Post
OSCII-bot is great for OSC/MIDI routing. Only downside is that it runs outside of REAPER and is therefore not suited for calling ReaScript functions.
The best solution would clearly be if ReaScript would get a possibility of sending OSC messages.
OSCIIBot as a plugin with standard Midi I/O also would be very nice to have.
Supposedly ReaLearn can do this, but for very dedicated OSC stuff,OSCIIBot seems nice and compact.
mschnell 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 05:10 PM.


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