The reason why is by refering to tracks and devices by index, whenever you move or add a track or device, you have to update all your OSC messages since they are handled outside of Renoise.
If you’re up for Lua hacking you can add your own OSC handlers to GlobalOscActions.lua. I think you would have to use a different address pattern than /renoise/song/track/ since that one is already in use.
I wrote an OSC handler to alter a track’s send devicereceiver. It looks at device names and send track names to figure out what to do.
It loops over all send tracks and checks the names on each call. I was thinking I would have to cache things to make it fast but so far it’s been fast enough (but I have no hard numbers to tell me the actual latency).
You can add a new handler that loops over allsequencertracks and checks the name. The code would then have to do the same checking device names.
Oh so I would have a static address sent to Renoise and my tool would simply find the device name and redirect it. This is nice. Thanks
I don’t know what you mean by “static address sent to Renoise”.
You have your OSC client point to the IP of themachinerunning Renoise and whatever port you have Renoise OSC using (8000, I think, is the default). And you extend the built-in set of Renoise OSC handlers by adding your own to your personal GlobalOscActions.lua file.
The handler code would do something like this:
add_global_action {
pattern = "/song/track/update-device",
arguments = {
argument("target_track_name", "string"),
argument("taget_device_name", "string"),
argument("device_param_name", "string"),
argument("device_param_arg", "number"),
},
handler = function(taget_track_name, taget_device_name, device_param_name, device_param_arg)
local track
for i = 1,#renoise.song().tracks do
if renoise.song().tracks[i].name == target_track_name
track = renoise.song().tracks[i]
local devices = tracks[track_index].devices
if (#devices > 0 ) then
local i, j
for device_idx, device in ripairs(devices) do
if device.display_name == taget_device_name then
-- find the param
for __,param in ipairs(device.parameters) do
if param.name == device_param_name then
param.value = device_param_arg
break
end
end
end
end
end
end
end
}
Not tested.
Note that since this is a global action it does not allow for the nicer address pattern of the usual /renosie/song/track/NNN/stuff.
So. not as nice as when you index by a number instead of a name.
By “static” i meant the OSC client will always send the same address (ie. something referring to track “Hihat”, device “Filter” but theGlobalOscActions.lua will pick up that new kind of message and identify the index of the track in device for me… I guess that’s how I assume it works, or does it seek for the track and device without “rerouting” back my message into the usual /renoise/song/track/1/device/1?
Anyway. Doing this is a bit of a stretch for me but I think it’s worth the effort. I’m working on this right now. Thanks for your help! I’ll document my progress here.
Edit:
Okay… I had to fix a couple typos but it actually works… I’m surprised how easy that was!
Thanks a lot, your code was the shortcut I needed. I don’t code and I don’t know lua but I knew just enough to add it and fix it.
Here’s the final code:
add_global_action {
pattern = "/song/track/update-device",
arguments = {
argument("target_track_name", "string"),
argument("target_device_name", "string"),
argument("device_param_name", "string"),
argument("device_param_arg", "number"),
},
handler = function(target_track_name, target_device_name, device_param_name, device_param_arg)
local track
for i = 1,#renoise.song().tracks do
if renoise.song().tracks[i].name == target_track_name then
track = renoise.song().tracks[i]
local devices = track.devices
if (#devices > 0 ) then
local i, j
for device_idx, device in ipairs(devices) do
if device.display_name == target_device_name then
-- find the param
for __,param in ipairs(device.parameters) do
if param.name == device_param_name then
param.value = device_param_arg
break
end
end
end
end
end
end
end
end}
or does it seek for the track and device without “rerouting” back my message into the usual /renoise/song/track/1/device/1?
Once the handler has a reference to the track and the device there’s no reason to reroute. The handler just does whatever it was asked to do with the message arguments.