Notifiers & Values

From what I can tell I need to use value in the slider object to get it to do something.
So far I have the first slider working:

 -- slider  
 local slider_row =   
 vb:horizontal_aligner {  
 mode = "center",  
 width = "100%",  
 vb:row {  
-- style = "border",  
 vb:slider {  
 min = 0.0,  
 max = 1.0,  
 value = 0,  
 width = 125,  
 notifier = function(value)  
 client:send(  
 OscMessage("/1/fader5", {   
 {tag="f", value=value}   
 })  
)  
 show_status(("slider value changed to '%.1f'"):  
 format(value))  
 end  
 }  
 }  
}  
  
 -- v sliders  
 local vslider_column1 =   
 vb:horizontal_aligner {  
 mode = "center",  
 width = "100%",  
 vb:column {  
-- style = "border",  
 margin = CONTENT_MARGIN,  
 spacing = CONTENT_SPACING,  
-- uniform = true,  
 vb:row {  
 vb:slider {  
 min = 0.0,  
 max = 1.0,  
 value = 0.5,  
 width = 30,  
 height = 150,  
 notifier = function(value)  
 OscMessage("/1/fader1", {   
 {tag="f", value=value}   
 })   
 show_status(("v slider value changed to '%.1f'"):  
 format(value))  
 end  
 },  
 -- v slider1  
 vb:slider {  
 min = 0.0,  
 max = 1.0,  
 value = 0,  
 width = 30,  
 height = 150,  
 notifier = function(value)  
 OscMessage("/1/fader2", {   
 {tag="f", value=value}   
 })  
 show_status(("v slider value changed to '%.1f'"):  
 format(value))  
 end   
 },  

but the rest of them won’t function unless I remove the OscMessage from the value.

I also have an OSC server running in this, on a different port that I will need to call in I guess the same notifier, is this possible?

  
-- this does not do anything except creating an Osc message  
OscMessage("/1/fader5", {   
 {tag="f", value=value}   
)  
  
-- but this creates an Osc message and also sends it somewhere  
client:send(  
 OscMessage("/1/fader5", {   
 {tag="f", value=value}   
})  
  
?  
  

:eek:

Thanks for Spotting that!!
This fixes every slider and rotary send from renoise in my touchosc tool.
Now that I now I was going in the right direction, I should be able to apply this to the toggle buttons and push buttons, push buttons might be a chore.

Now I have to find out why I can’t get remote connections to the OSC server I make in renoise(only internal 127.0.0.1)

It’s the strangest issue so far. If I use 127.0.0.1 I can get all the messages I send internally.
If I change that to my private lan 192.168.255.255, I get this:

*** TestPad.lua:15: variable 'app' is not declared  
*** stack traceback:  
*** [C]: in function '_error'  
*** [string "local mt = getmetatable(_G)..."]:29: in function   
*** TestPad.lua:15: in main chunk  

from this that I patched together from the Docs:

local OscMessage = renoise.Osc.Message  
local OscBundle = renoise.Osc.Bundle  
local server, socket_error = renoise.Socket.create_server(  
 "192.168.12.32", 8008, renoise.Socket.PROTOCOL_UDP)  
  
if (socket_error) then   
 app:show_warning(("Failed to start the " ..   
 "OSC server. Error: '%s'"):format(socket_error))  
 return  
end  
---ithings address  
local client, socket_error = renoise.Socket.create_client(  
 "192.168.12.34", 8007, renoise.Socket.PROTOCOL_UDP)  
  
if (socket_error) then   
 app:show_warning(("Failed to start the " ..   
 "OSC client. Error: '%s'"):format(socket_error))  
 return  
end  
  
--------------------  
  
server:run {  
 socket_message = function(socket, data)  
 -- decode the data to Osc  
 local message_or_bundle, osc_error = renoise.Osc.from_binary_data(data)  
  
 -- show what we've got  
 if (message_or_bundle) then  
 if (type(message_or_bundle) == "Message") then  
 print(("Got OSC message: '%s'"):format(tostring(message_or_bundle)))  
  
 elseif (type(message_or_bundle) == "Bundle") then  
 print(("Got OSC bundle: '%s'"):format(tostring(message_or_bundle)))  
  
 else  
 -- never will get in here  
 end  
  
 else  
 print(("Got invalid OSC data, or data which is not " ..   
 "OSC data at all. Error: '%s'"):format(osc_error))  
 end  
  
 client:send(("%s:%d: Thank you so much for the OSC message. " ..  
 "Here's one in return:"):format(socket.peer_address, socket.peer_port))  
  
 client:send(OscMessage("/flowers"))  
 end   
}  
  
local action_pattern_map = table.create{}  
  
local function argument(name, type)  
 return { name = name, type = type }  
end  
  
---------------------  
  
local function add_action(info)  
  
 assert(action_pattern_map[info.pattern] == nil,   
 "pattern is already registered")  
  
 assert(type(info.pattern) == "string" and type(info.handler) == "function",   
 "action info needs at least a pattern and handler function")  
  
 assert(not info.arguments or type(info.arguments) == "table",   
 "arguments should not be specified or should be a table")  
  
 assert(not info.description or type(info.description) == "string",   
 "description should not be specified or should be a string")  
  
 info.arguments = info.arguments or {}  
 info.description = info.description or "No description available"  
  
 action_pattern_map[info.pattern] = info  
end  
  
--------------------  
  
add_action {   
 pattern = "/evaluate",   
 arguments = { argument("expression", "string") },  
 description = "Evaluate a custom Lua expression, like i.g:\n" ..  
 "'renoise.song().transport.bpm = 234'",  
 handler = function(expression)  
 print(("OSC Message: evaluating '%s'"):format(expression))  
  
 local succeeded, error_message = evaluate(expression)  
 if (not succeeded) then  
 print(("*** expression failed: '%s'"):format(error_message))  
 end  
 end,  
}  
---  
add_action {   
 pattern = "/1/toggle1",   
 description = "Start playback or restart playing the current pattern. "..  
 "No arguments available.",  
 handler = function()  
 local play_mode = renoise.Transport.PLAYMODE_RESTART_PATTERN  
 renoise.song().transport:start(play_mode)  
 end,   
}  
  
-------------------  
  
-- construct and send messages  
client:send(  
 OscMessage("/1/toggle4", {   
 {tag="i", value=1}   
 })  
)  

I notice it’s mixture variable not included in the osc.lua snippet but the real question is:
Is this a drawback for creating servers?
The client has no problem sending messages on another port remotely, but I guess I’m just not sure what I’m doing wrong.

edited because I had the ips were misleading

“TestPad.lua:15: variable ‘app’ is not declared”

Where is the
“local app = renoise.app()” declaration?

That fixes part of the problem, now I can crash touchOSC! :D

now I know renoise is seeing what I’m sending!!!

Thank-you vV!

Got OSC message: '/1/fader5\0\0\0,f\0\0?/�'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>���'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>K\'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>q�4'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>���'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>��'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>��d'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>�%�'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>ė:'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>Ӷ�'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>���'  
Got OSC message: '/1/fader2\0\0\0,f\0\0>��b'  
Got OSC message: '/1/fader2\0\0\0,f\0\0?�Z'  
Got OSC message: '/1/fader2\0\0\0,f\0\0?  
B�'  
Got OSC message: '/1/fader2\0\0\0,f\0\0?�('  
Got OSC message: '/1/fader2\0\0\0,f\0\0?$�'  
Got OSC message: '/1/fader2\0\0\0,f\0\0?��'  

man 3 weeks, and renoise finally seeing it!!!

except for the loop, this is Awesome!!!