This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

rewrite Python code to Lua
#1
Hi!!

I am controlling an audio software with udp.
Follwoing is the python code working on the site.

Code:
from pythonosc.udp_client import SimpleUDPClient


ip = "172.28.11.110"
to_ableton = 11000
from_ableton = 11001
client = SimpleUDPClient(ip, to_ableton)

client.send_message("/topic/of/message", [a, b, c])

I want to execute this from LM so I need to rewrite this in Lua. 
I've tried follwoing code but I got an error "invalid value (table) at index 2 in table for 'concat'".
Could you help me write this code properly? 

Code:
local socket = require("socket")
local ip = "172.28.11.110"
local to_ableton = 11000
local from_ableton = 11001
local msg = {"/topic/of/message", {a, b, c}}
local udp = socket.udp()
udp:settimeout(1)
udp:setpeername(ip, to_ableton)
udp:send(table.concat(msg, " "))

Thank you very much for your help  Smile
Reply


Messages In This Thread
rewrite Python code to Lua - by Hadeel - 30.04.2023, 17:19
RE: rewrite Python code to Lua - by admin - 02.05.2023, 07:30
RE: rewrite Python code to Lua - by Hadeel - 03.05.2023, 11:00
RE: rewrite Python code to Lua - by admin - 03.05.2023, 11:17
RE: rewrite Python code to Lua - by Hadeel - 03.05.2023, 12:41

Forum Jump: