Home › Forums › General › Programming › UDP close on exit
- This topic has 11 replies, 3 voices, and was last updated 7 years, 4 months ago by fundorin.
-
AuthorPosts
-
December 9, 2016 at 5:53 pm #70542
I need a way to automatically close opened ports (mainly, UDP) on the following occasions: panel close, standalone quit, vst remove from host.
I also need a way to open udp port back with desired settings, so I could add a modulator button, which will close and then open udp port on button press (reset port).December 9, 2016 at 9:18 pm #70543Hi fundorin, use variation of this in your method to switch stuff:
panel:getProperty(“panelOSCEnabled”)
panel:setPropertyString(“panelOSCEnabled”,”0″)
—–/// 0 = OFF, 1 = ON ///—–panel:getProperty(“panelOSCPort”)
panel:setPropertyString(“panelOSCPort”,”7777″)
—–/// 7777 = port number to listen on ///—–panel:getProperty(“panelOSCProtocol”)
panel:setPropertyString(“panelOSCProtocol”,”4″)
—–/// 0 = Default, 1 = UDC, 2 = UNIX/LOCAL, 3 = TCP ///—–December 9, 2016 at 9:23 pm #70544Thanks, proton. Where did you get this info?
Did you try to get full string arguments instead of only first character today?
Could this issue be connected with atom’s announcement about luabind problems in Lua 5.3?December 9, 2016 at 9:35 pm #70545Hi, I checked the Utility panel on the right to see all the available properties and no, sorry, I am still at work and will have to stay longer today so maybe on the weekend I will try the string thing. Let us know how is the progress, cheers!
December 9, 2016 at 9:37 pm #7054623:40 here, in Russia, now. 😉
December 10, 2016 at 1:45 pm #70547I’ve been able to add button that enables UDP port and sets it to 9999. That’s fine.
The thing is that if I remove Ctrlr vst from Reaper and add it again, osc commands aren’t showing in console, anymore.
I believe, this is happening because when vst plugin is deleted from FX chain, Ctrlr doesn’t close UDP port, so the new instance can’t communicate via that port.
Is there a trigger in Ctrlr, that will launch Lua script on panel close/Ctrlr remove from host?December 10, 2016 at 2:27 pm #70548you might be right, the destructor of the OSC subsystem wasn’ calling close, i fixed that, once i do a new build this will be fixed
December 10, 2016 at 2:33 pm #70550Glad to here from you, atom.
This and OSC handler method in CtrlrPanelOSС.cpp (lines 159-185) are the only two things preventing me from making a fully working MIDI<>OSC bridge. If Ctrlr would correctly open/close udp ports and handle strings, I would be happy.December 10, 2016 at 5:31 pm #70556i’ll fix the port closing issue, what about the handler functions what do you need from them ?
December 10, 2016 at 5:40 pm #70557I wrote about it at Github. I can’t find a way to get string agrument/value from OSC command. Only float or int numbers.
Instead of returning a string, this function returns only the first character.
arguments table contains some userdata and I don’t know how to retreive string value out of it.
The code below is what I’m using.onOSCMessage = function(path, types, arguments) action = path oscType = types if types=='f' then value = tonumber(arguments[0].f) elseif types=='s' then value = string.format('%s', arguments[0].s) end console('OSC: '..action..' Value: '..value..' Type: '..oscType)
And this is the console output. When I’m selecting a track, Reaper returns track name. In this case, the name of the track is “qwerty”, but the value shown is 113, which is a decimal representation of the first character in the name, which is “q”.
LUA>> OSC: /device/track/select/2 Value: 1 Type: f LUA>> OSC: /track/name Value: 113 Type: s LUA>> OSC: /track/2/name Value: 113 Type: s
I’ve tried different ways to get the full string, but nothing worked.
December 11, 2016 at 12:37 am #70563i found the problem, fixing it now, its a hard one
December 11, 2016 at 8:05 am #70567Thank you. Will be waiting for an update.
P.S. Sent you a private message, that might be important.
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.