Osc Discussion (How Where What To Use Osc)

Well, for your actual problem, the parameter is read only. Not what you claim.

But in the future, where you actually need to declare a device, can MaxMSP send multiline Lua?

For example, using a SongPos object, you could do something like:

  
$m = new OSCMessage("/renoise/evaluate", array('  
 local my_pos = renoise.SongPos()   
 my_pos.sequence = 1  
 my_pos.line = 16  
 renoise.song().transport.playback_pos = my_pos  
'));  
  

Thanks!

Yes, yes it can, here’s a port of your SongPos script to MaxMSP
[luabox]
{
“patcher” : {
“fileversion” : 1,
“rect” : [344.0, 84.0, 458.0, 308.0],
“bglocked” : 0,
“defrect” : [344.0, 84.0, 458.0, 308.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” : “t b b i b”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 4,
“outlettype” : [“bang”, “bang”, “int”, “bang”],
“patching_rect” : [15.0, 45.0, 59.5, 20.0],
“id” : “obj-25”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “number”,
“minimum” : 1,
“numinlets” : 1,
“maximum” : 64,
“fontsize” : 12.0,
“numoutlets” : 2,
“outlettype” : [“int”, “bang”],
“patching_rect” : [15.0, 15.0, 50.0, 20.0],
“id” : “obj-24”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “sprintf symout my_pos.line = %i”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [“”],
“patching_rect” : [90.0, 135.0, 180.0, 20.0],
“id” : “obj-22”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “"renoise.song().transport.playback_pos = my_pos"”,
“numinlets” : 2,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [“”],
“patching_rect” : [135.0, 165.0, 279.0, 18.0],
“id” : “obj-9”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “"my_pos.sequence = 1"”,
“numinlets” : 2,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [“”],
“patching_rect” : [45.0, 105.0, 137.0, 18.0],
“id” : “obj-5”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “message”,
“text” : “"local my_pos = renoise.SongPos()"”,
“numinlets” : 2,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [“”],
“patching_rect” : [15.0, 75.0, 202.0, 18.0],
“id” : “obj-3”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “print”,
“numinlets” : 1,
“fontsize” : 12.0,
“numoutlets” : 0,
“patching_rect” : [165.0, 255.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, 225.0, 149.0, 20.0],
“id” : “obj-15”,
“fontname” : “Arial”
}

}
, {
“box” : {
“maxclass” : “newobj”,
“text” : “sprintf symout %s %s %s %s”,
“numinlets” : 4,
“fontsize” : 12.0,
“numoutlets” : 1,
“outlettype” : [“”],
“patching_rect” : [15.0, 195.0, 165.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, 255.0, 137.0, 20.0],
“id” : “obj-1”,
“fontname” : “Arial”
}

}
],
“lines” : [ {
“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-10”, 0],
“destination” : [“obj-15”, 0],
“hidden” : 0,
“midpoints” :
}

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

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

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

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

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

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

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

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

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

}
]
}

}
[/luabox]

here is Beatslaugher’s reply to vV’s post on the api inconsistency thread

it should be (to control mixer faders via osc):

  
/renoise/evaluate renoise.song().tracks[].prefx_volume.value = float  
  

i was typically missing out setting the property ‘value’ as renoise.song().tracks.prefx_volume is an instance of the class DeviceParameter

oprint definitely is your friend

and a MaxMSP patch controlling just track 1’s fader.
[luabox]
{
“patcher” : {
“fileversion” : 1,
“rect” : [40.0, 89.0, 377.0, 304.0],
“bglocked” : 0,
“defrect” : [40.0, 89.0, 377.0, 304.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” : “scale 0 127 0. 1.412”,
“id” : “obj-3”,
“numinlets” : 6,
“fontname” : “Arial”,
“numoutlets” : 1,
“outlettype” : [“”],
“fontsize” : 12.0,
“patching_rect” : [15.0, 165.0, 119.0, 20.0]
}

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

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

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

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

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

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

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

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

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

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

}
]
}

}
[/luabox]

I haven’t figured out how to send the lua strings through evaluate from pure data.
None of renoise’s OSC implementation makes much sense to me though, so that probably doesn’t mean much. :P

You need to make sure that pd is sending only one argument of type symbol via the /renoise/evaluate osc message

From tosymbol-help.pd
since pd lacks a quoting mechanism (like foo bar) there is no support for spaces in symbols. One has to construct symbols with other tools like the tosymbol or makesymbol objects.

I’m using the sprintf object with the symout argument to construct in MaxMSP (kind of like C-language “printf” function) and i’m not a full time pd user so i don’t know if there’s an equivalent in pd.

I’m new to the renoise board as you can see and I’m happy to provide pointers, but as Conner_Bw pointed out earlier in the thread.

so you may want to try asking on the Pure Data forum~ for further advice.

i’ve agreed to help taktik with a tutorial on all this osc stuff. would the same examples created in various popular osc capable software be useful?

hmm, figured this one out:

\  
--renoise.app().window:maximize()  
  
add_action {   
 pattern = "/window/max",   
 description = "maximize window",  
 handler = function()  
 renoise.app().window:maximize()  
 end,  
}  
  
--renoise.app().window:minimize()  
  
add_action {   
 pattern = "/window/min",   
 description = "minimize window",  
 handler = function()  
 renoise.app().window:minimize()  
 end,  
}  
  

can’t get fullscreen or restore to work, but those work.

Originally was trying to figure out the window:presets.
With this I had it not giving me rejected messages and no errors but it wasn’t doing anything visually discernible.

  
-- renoise.app().window:select_preset(preset_index)  
  
add_action {   
 pattern = "/window/activate_gui_preset",   
 arguments = { argument("select_preset", "preset_index") },   
 description = "Show GUI Preset [1-8]",  
 handler = function(select_preset)  
 renoise.app().window.select_preset = preset_index  
 end,  
}   
  

this one throws errors as I have seemed to forget how or why it was working. :D

Welcome to the board! :)

Thanks for that explanation, I spent probably 3-4 hours so far trying different things and searching for answers to why I couldn’t get that interpreted with evaluate.

I’ve been focused on adding actions into GlobalOscActions.lua, the evaluate function while much more useful and powerful, I frankly just don’t comprehend. Essentially I’ve been trying to index what we can do without using evaluate. That’s why I’ve been posting the lua code for the actions. At first I thought I could figure out a lot by just asking why certain actions didn’t work, now that I’ve seen deeper, I seriously feel like I’m going blind. :D

With tracking, all the commands are right here to experiment with, we know the names of everything and it’s as simple as looking at a list with usage parameters. With the scripting we have now, I feel like I’m endlessly looking for a shamrock.

I keep wishing I could find a function of some form of List that would just shoot out a huge amount of objects, properties, descriptions and examples. :)

Just a quick question without testing this myself here → Have you tried this?:
renoise.app().window.select_preset = tonumber(preset_index)

Sometimes you get stuff in strings while the function you parse it to expects numbers (or vice versa).
And checking if it ain’t nil is one or the more primary things to do…
if preset_index ~= nil then
dostuff with preset_index
end

here you go… /renoise/evaluate for pd
http://dl.dropbox.com/u/111045/RenoiseOscEvaluate.pd

Including send malicious code… Haha.

Seriously though, someone doing a live performance with port 8000 open, people should be aware and firewall accordingly.

OH Man sambiotic, that is exemplary!

I’ve been trying to find out exactly what you displayed in that pd file all week! :)

With just that example/explanation of yours, I should be able to modify several of the pd patch examples for touchOSC to control the mixer in Renoise, full OSC.
I have something awesome to do today! Thanks so much!

No problem.
Now for fun, I’ve made pd send a multiline lua script.
http://dl.dropbox.com/u/111045/RenoiseOscEvaluateMulti.pd

I need to get stuck into sending osc from renoise now.

I got faders on page 1 of touchOSC to work using the simple-layout pd patch from hexler’s site and your (sambiotic) example with the prefx volume control. :)

http://wikisend.com/download/536944/touchOSC-Renoise-simple-receive.pd

Started thinking I could bring this completely into renoise with something like this:

  
 pattern = "/1/fader1",   
 arguments = { argument("prefx_volume", "numbers") },   
 description = "track 1 volume",  
 handler = function()  
 renoise.song().tracks[1].prefx_volume.value = float  
 end,  
}  
  

Then I remembered touchOSC can’t really prepend “/renoise” to the address.
I found touchOSC and remokon sends everything like /1/fader1 & /0/sliderA

first part “/1” (touchOSC) & “/0” (remokon) refers to page numbers, then the 2nd part is the object.

gets complex with the matrix style grids, when arrays of multi-toggle, toggle switches and push buttons come into play.

I tried writing my own lua code to evaluate for mute and width.

sprintf renoise.song().tracks[1].mute.value:1
sprintf renoise.song().tracks[1].prefx_width.value = %f

Even though they don’t work, I left them in the pd sub patch.
page-1
mute = /toggle1
width = /fader5

I recently became curious about VLC and renoise, and I just found this:
http://wiki.videolan.org/Documentation:Modules/osc

With TouchOSC what OSC string it sends depends on how the layout your using is made.
fortunately you can edit the layouts with the touchosc editor.

I’ve tried that quite a bit, for whatever reason I couldn’t get much if anything it sends to work with renoise.
Have you been successful at getting it to work with renoise at all?
No one knows a thing about it here.

I started working on a interface for it:

thought I would start with the default layouts, but missing a couple control types.
thinking I might be able to somehow connect what it sends with something renoise can interpret.

I wish I had looked at this earlier.

Can I use the methods in the GlobalMidiActions.lua as a basis for making methods in GlobalOscActions.lua?

they look so very similar.

I guess what I’m really trying to ask is, can I do everything Midi can do with OSC in Renoise?

Please tell me yes! That GlobalMidiActions file is so ripe!

Hey Moonriders, this is future you. Hi.

The answer is…
YES.

see:

MIDI

  
add_action("Transport:Playback:Panic [Trigger]",  
function(message)  
 if message:is_trigger() then  
 song().transport:panic()  
 end  
end)  
  

translates to this:
OSC

  
add_action{  
 pattern = "/transport/playback/panic",  
 desription = "AHHHHHHHH!@!@#*($^!(@#^%_!(%$!!!!!!!!!",  
 handler = function()  
 renoise.song().transport:panic()  
 end,  
}  
  

Hi Bantai :)

In your opinion for windows, slikSVN or tortiseSVN?

Thanks Bantai, just tried both and tortoiseSVN has the explorer addons, that’s pretty nice!
I should probably start a new thread about SVN, as I have a few questions about SVN and renoise’s directories.

I haven’t had a chance to look at it but is this

what you linked?
Looks Damn interesting!

As for me, not really trying to go Midi, just cheating by taking what was written in GlobalMidiActions.lua and trying to figure out how to re-purpose it for OSC. :)