Hi,
Can anybody tell me why this code snippet is not firing notes in Renoise when run in the scripting terminal/editor:
local server, client
-------------------------------------------------------------------------------
---- Osc server (receive Osc from one or more clients)
-- open a socket connection to the server
if not server then
local socket_error
server, socket_error = renoise.Socket.create_server(
"localhost", 8008, renoise.Socket.PROTOCOL_UDP)
if (socket_error) then
renoise.app():show_warning(("Failed to start the " ..
"OSC server. Error: '%s'"):format(socket_error))
return
end
print('hit')
end
server:run {
socket_message = function(socket, data)
-- decode the data to Osc
local message, osc_error = renoise.Osc.from_binary_data(data)
-- show what we've got
if (message) then
if (type(message) == "Message") then
print(message.pattern)
rprint(message.arguments)
end
else
print(("Got invalid OSC data, or data which is not " ..
"OSC data at all. Error: '%s'"):format(osc_error))
end
end
}
-------------------------------------------------------------------------------
-- Osc client & message construction (send Osc to a server)
-- open a socket connection to the server
if not client then
local socket_error
client, socket_error = renoise.Socket.create_client(
"localhost", 8008, renoise.Socket.PROTOCOL_UDP)
if (socket_error) then
renoise.app():show_warning(("Failed to start the " ..
"OSC client. Error: '%s'"):format(socket_error))
return
end
print('hit2')
end
-- construct and send messages
client:send(
renoise.Osc.Message("/renoise/trigger/note_on", {
{ tag="i", value=1 },
{ tag="i", value=1 },
{ tag="i", value=60 },
{ tag="i", value=64 }
})
)
Itās mainly copied from the OSC snippet in the xrnx dev package. Iāve looked at Duplex and xLib and all that, and see similar constructions. This fires the print statements, but will not play any notes.
Halp.