Osc Discussion (How Where What To Use Osc)

awesome.
that was the first value i decided to test so i guess we were lucky there.

@Niall you should be able to modify the above to work with your signal follower.

bi-directional osc communication between renoise and maxMsp to keep track 1 prefx slider in sync in both pieces of software

Renoise lua
[luabox]
local OscMessage = renoise.Osc.Message

local client, socket_error = renoise.Socket.create_client(
“localhost”, 8008, renoise.Socket.PROTOCOL_UDP)
if (socket_error) then
app:show_warning(("Failed to start the " …
“OSC client. Error: ‘%s’”):format(socket_error))
return
end

function send_osc()
client:send(
OscMessage("/renoise/song/tracks/1/prefx_volume", {
{tag=“f”, value=renoise.song().tracks[1].prefx_volume.value}
})
)
end

function attach_to_song()
renoise.song().tracks[1].prefx_volume.value_observable:add_notifier(
send_osc
)
end

renoise.tool().app_new_document_observable:add_notifier(
attach_to_song
)
[/luabox]

maxMsp 5 patch
[luabox]
{
“patcher” : {
“fileversion” : 1,
“rect” : [16.0, 50.0, 393.0, 438.0],
“bglocked” : 0,
“defrect” : [16.0, 50.0, 393.0, 438.0],
“openrect” : [0.0, 0.0, 0.0, 0.0],
“openinpresentation” : 0,
“default_fontsize” : 12.0,
“default_fontface” : 0,
“default_fontname” : “Arial”,
“gridonopen” : 0,
“gridsize” : [15.0, 15.0],
“gridsnaponopen” : 0,
“toolbarvisible” : 1,
“boxanimatetime” : 200,
“imprint” : 0,
“enablehscroll” : 1,
“enablevscroll” : 1,
“devicewidth” : 0.0,
“boxes” : [ {
“box” : {
“maxclass” : “newobj”,
“text” : “prepend set”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [""],
“patching_rect” : [15.0, 135.0, 74.0, 20.0],
“id” : “obj-17”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “scale 0. 1.412 0 127”,
“numinlets” : 6,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [""],
“patching_rect” : [15.0, 105.0, 119.0, 20.0],
“id” : “obj-16”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “flonum”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 2,
“outlettype” : [“float”, “bang”],
“patching_rect” : [15.0, 75.0, 50.0, 20.0],
“id” : “obj-8”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “osc-route /renoise/song/tracks/1/prefx_volume”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 2,
“outlettype” : ["", “”],
“patching_rect” : [15.0, 45.0, 257.0, 20.0],
“id” : “obj-5”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “udpreceive 8008”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [""],
“patching_rect” : [15.0, 15.0, 99.0, 20.0],
“id” : “obj-4”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “scale 0 127 0. 1.412”,
“numinlets” : 6,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [""],
“patching_rect” : [15.0, 315.0, 119.0, 20.0],
“id” : “obj-3”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “slider”,
“numinlets” : 1,
“numoutlets” : 1,
“outlettype” : [""],
“patching_rect” : [15.0, 165.0, 20.0, 140.0],
“id” : “obj-2”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “print”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 0,
“patching_rect” : [165.0, 405.0, 34.0, 20.0],
“id” : “obj-52”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “prepend /renoise/evaluate”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [""],
“patching_rect” : [15.0, 375.0, 149.0, 20.0],
“id” : “obj-15”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “sprintf symout renoise.song().tracks[1].prefx_volume.value = %f”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [""],
“patching_rect” : [15.0, 345.0, 349.0, 20.0],
“id” : “obj-10”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “udpsend localhost 8000”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 0,
“patching_rect” : [15.0, 405.0, 137.0, 20.0],
“id” : “obj-1”,
“fontname” : “Arial”
}

}
],
“lines” : [ {
“patchline” : {
“source” : [“obj-8”, 0],
“destination” : [“obj-16”, 0],
“hidden” : 0,
“midpoints” : []
}

}
, {
“patchline” : {
“source” : [“obj-16”, 0],
“destination” : [“obj-17”, 0],
“hidden” : 0,
“midpoints” : []
}

}
, {
“patchline” : {
“source” : [“obj-17”, 0],
“destination” : [“obj-2”, 0],
“hidden” : 0,
“midpoints” : []
}

}
, {
“patchline” : {
“source” : [“obj-4”, 0],
“destination” : [“obj-5”, 0],
“hidden” : 0,
“midpoints” : []
}

}
, {
“patchline” : {
“source” : [“obj-5”, 0],
“destination” : [“obj-8”, 0],
“hidden” : 0,
“midpoints” : []
}

}
, {
“patchline” : {
“source” : [“obj-10”, 0],
“destination” : [“obj-15”, 0],
“hidden” : 0,
“midpoints” : []
}

}
, {
“patchline” : {
“source” : [“obj-15”, 0],
“destination” : [“obj-52”, 0],
“hidden” : 0,
“midpoints” : []
}

}
, {
“patchline” : {
“source” : [“obj-15”, 0],
“destination” : [“obj-1”, 0],
“hidden” : 0,
“midpoints” : []
}

}
, {
“patchline” : {
“source” : [“obj-3”, 0],
“destination” : [“obj-10”, 0],
“hidden” : 0,
“midpoints” : []
}

}
, {
“patchline” : {
“source” : [“obj-2”, 0],
“destination” : [“obj-3”, 0],
“hidden” : 0,
“midpoints” : []
}

}
]
}

}

[/luabox]

… will be fixed in the next beta (same for LPB, TPL - all others should be OK) …

Ah, thanks so much, but I’ve been trying it with no luck so far.

not sure if I’m putting it in the right place, i’ve tried in both instances of globaloscactions, and it says it needs a tool, so I’ve tried popping the code in a main.lua, and then in a folder called com.renoise.oscactions.xrnx

Clearly I’m inexperienced here, but any chance you could tell me how you did it?

EDIT: AGAIN, Figured it out. I hadn’t set up the tool properly, this is my first time with tools.

samB, this is so rad.

Videos soon.

glad you got it working.
it would be nice to see what you have created, looking forward to the videos.

:D

aw man, that’s cheating.

Pretty cool, are there already touchosc kinda apps for the ipad? Also, are these touchscreen devices multi-touch like the lemur or can you only move one slider at a time (nevermind, watched the video again)? Could google heh :) , but I probably never buy those devices as I don’t see myself rubbing screens on stage, also the need to run pd in the back controlling midi, kinda defeats the purpose of Renoise supporting osc, no? Still, nice that it is all possible!

From what I understand of the video, they are using PD because there are predefined templates that match the iPad interfaces, ready to go. A “pure renoise (PR?)” version would be:

  1. Build an interface for Touch OSC with the touch OSC editor. link
  2. Build an XRNX that interfaces with #1
  3. Distribute both together as an “all-in-one”

This is sort of what Duplex does, but the difference is Duplex is mapping hardware, a static interface, where as TouchOSC is an arbitrary interface.

There is a few things in touchOSC that renoise’s viewbuilder can’t really compensate for: a multi-slider and an XY interface.
Those can be handled in the tool, but in a Duplex like tool it would be hard to visualize?

I have been thinking about this tremendously, and just tonight I realized a proper tool renoise side would need the inputs definable from the interface, that’s a huge amount of renoise internals, and would require a few classes and stuff I don’t get yet. This stuff is super complicated.
I’ve been able to send from one fader seperately in renoise to touchOSC tonight from these 2 interfaces:

I can start a seperate OSC server inside the 2 tools but I haven’t been able to discernably pass anything to it from a remote address.

for internal addresses it keeps telling me I have a disconnected client.
like this:

Got OSC message: '/evaluate\0\0\0,s\0\0renoise.song().tracks[1].prefx_volume.value = 0.35578\0\0\0'  
*** std::logic_error: 'socket_client: trying to send messages from a disconnected client.'  
*** stack traceback:  
*** [C]: in function 'send'  
*** TestPad.lua:56: in function <32><br>
<br>```

<br>
<br>
from this:<br>

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

</32>

Ok, this is weird.

I don’t see your screens-shots when reading your messages. When I reply, I see you are using the correct BBCODE, but when I browse I don’t see the images…

Is this a bug with the forums? See attachment.

The forum is quite buggy on more areas…
I guess we had one bad update a while ago.
Also inline edit messes up big time in Firefox.

you have images turned off.
i do too, that’s how I know. :)

Don’t know about Conner, but i don’t and i don’t see that image either.

strange, do you have avatars turned off?

can you see it if you go to the link?

maybe If i turn on my images you could see it? :P

can you guys see this?

On the note of touch screens, I’d rather use this kind of screen :)

http://vimeo.com/13724835

I see this one.

In that case, turning off images on our sides, allows us to hide images in our posts.

What I did was I turned on images, and then posted that image.
previously I had images turned off.

Now if I want to post an image, I will turn on images.
Strange how that works.

I don’t know if I can embed this, but here’s a quick video of some stuff.