Osc Discussion (How Where What To Use Osc)

I spent a good while looking at the OSC section of the prefs.

Fucking beautiful! :panic:

A few things stand out to me, like data types. “(number)” would denote integer or float, and from what I can tell the transport has no arguments but uses strings right?

Also tried the evaluate example, but I’m not positive I wrote it correctly, does this need to be sent from the internal scripting?

I started on making a touchOSC interface, but I keep getting my messages rejected, this might be due to touchOSC, so I am seeking input with this also.

Ah, so Duplex I believe is what I need to look at for interaction with touchOSC.

Starting to figure this out,looking at this better with SC3, “/renoise/transport/start” <—message string

b = NetAddr.new(“127.0.0.1”, 8000); // create the NetAddr
b.sendMsg("/renoise/transport/start");// send renoise the message “/renoise/transport/start” with no argument

it works! :)

same with “/renoise/transport/stop”

awesome to see that you’re getting into this Moonriders! I am very eager to get Touch OSC controlling Renoise without the Pure Data workaround.

I poked around in the Duplex code and documentation… but i’m very very very far from being a coder of any sort…

I’ve got a lot to learn before i can contribute to the community with scripts, just saying “big up!” and “thanks!” for working on Touch OSC things!!!

I’m still at the gates with touchOSC, I’m having much more luck with OSCemote and SC3 at the moment.

I can’t seem to get much more than start and stop at the moment. I had touchOSC do something with LPB but, all it did was send the LPB to 1 and nothing else. :D

Must have the syntax wrong as I can’t figure out why “/renoise/trigger/note_on(-1,-1,77,77)” isn’t working for me. I’m pretty sure this is a bundle, telling renoise current instrument, current track, note 77, vel 77.

I’m stumped.

also had a look at this:
http://xrnx.googlecode.com/svn/trunk/Documentation/Renoise.Osc.API.txt

although it’s very specific to lua’s handing I think.

This looks OK. Do you at least get some “Rejected” messages in the renoise OSC preferences?
If you get an REJECTED, the you know that at least something was received, but either the pattern did not match or the parameters did not match.

Yes, its not even Luas OSC handling, it Renoises OSC handling. It won’t really help you with SC3.

But you don’t have to send a bundle. A single message will work as well.

Yes, I do get the rejected message, A Lot. :lol:

something like this:
“/renoise/transport/bpm(67)” will get the rejected message, I’ve tried many variations like:
“/renoise/transport/bpm(value=67)”
“/renoise/transport/bpm”,“67”
“/renoise/transport/bpm(number=67)”

Lot’s of variations of those, for bpm and lpb.

I stopped short of trying much “/renoise/trigger/midi” yet, as I’m not certain what format the bundle messages need to be. Maybe something like “Ch1|CC1”?

I just downloaded the scripting pack, it seems to me touchOSC would be much more suited with Duplex. Thinking I need to start reading the Duplex threads.

After having a look at everything,
I’m definitely not going to be able to do any of this for at least,
/many/year(s).

I need to go build a sailboat.

I just found out pure data sends the message bundles properly.
send /renoise/transport/lpb 8
is accepted in Renoise.

TouchOSC is a puzzle, OSCemote is also a puzzle. Both of these look to be needing a scripting interface similar to Duplex, I could imagine the other OSC apps for iphone will also need a scripting interface. haven’t tried mrmr or remokon yet.

iOSC is capable of sending bpm & lpb, but crashes with strings like start and stop. triggers is not worth trying on this.

Just looked into remokon, it will definitely need a Duplex like interface.

Hey, Moonriders. Yes, from what I understand there are dozens of little controller apps for the iThings. Each app comes with several different options and layouts, so it’s really a mountain of information.

But if you simply need some TouchOSC/OSCemote/etc fader or button to control a certain parameter in Renoise, then Duplex is overkill. This is a one-to-one mapping, which is much more easily done by modifying GlobalOscActions.lua. Use Duplex only if you really need it. If you want to ‘write something once, and run it everywhere’, then Duplex is your friend. But check out GlobalOsc/MIDIActions.lua first.

Whoa thanks danoise.
So the list in the OSC Prefs area is really just a list of examples then,
and I can add functionality to that area?

Say if I wanted to add an edit button somewhere in an iThing, I would do something like this?

  
add_action {   
 pattern = "/transport/edit",   
 description = "Start Editing(boolean)",  
 handler = function()  
 renoise.song().transport.edit_mode(?)  
 end,  
}  
  

man, this makes so much more sense looking at GlobalOscActions.

I don’t know what TouchOSC does. I never looked at it.

I imagine it’s similar to Open Sound Control (OSC) Client Library for PHP (attached)

Basically, it’s some “program” that sends “stuff” to Renoise. The “program” has it’s own way of writing code, and its up to you to research how it works.

Example OSC PHP code:

  
$c = new OSCClient();  
$c->set_destination("127.0.0.1", 8000);  
  
$m = new OSCMessage("/renoise/evaluate", array(  
 'renoise.song().transport.bpm = 500'  
 ));  
$c->send($m);  
  
$m = new OSCMessage("/renoise/transport/start");  
$c->send($m);  
  
sleep(5);  
  
$m = new OSCMessage("/renoise/transport/stop");  
$c->send($m);  
  

In the above I:

  1. Set the song bpm to 500
  2. Start
  3. Wait 5 seconds
  4. Stop the song.

This is the PHP Osc format of sending messages. I know this because I opened the PHP OSC file and read the documentation in the file.

Notice the BPM part of the code above. I’m sending Lua here. The OSC Prefs that danoise mentions is just an easier way to do things. Instead of setting the bpm in the PHP Code (remember this is just “my program”, it’s the conceptual equivalent to TouchOSC) you do it on the side of Renoise, and make it easier on yourself by calling, say /renoise/my_bpm where my_bpm() is some lua coce you made up yourself that does what you want on the Renoise side.

You have to read more about TouchOSC, it must document how it sends messages?

Good times.,

This command. It evaluates LUA string. Is that really neccesary for setting the BPM? :S

:lol: He was just telling me I should have read the manual.

I’m going to try and duck out of this thread,
as I have no idea what I have gotten myself into.
If I’m back in this thread tomorrow It’ll show how stubborn I am.

I keep thinking this should work:
add_action {
pattern = “/transport/edit”,
description = “Start Editing(boolean)”,
handler = function()
renoise.song().transport.edit_mode()
end,
}

but I have no idea where the variables are being declared or not. :D along with so many other things, it took me 4 hours to finally post this.

what does _observable mean?

_observable means that you can observe that property:

Lets say you have foo.blah.some_property

If you do: foo.blah.some_property_observable:add_notifier(some_function)

Then the some_function is called every time some_property changes.

Yes a very nice way to add timers and interrupts into your processes (for example getting some breathing space inside an eternal loop and allow to break out of it)
The Nibbles source uses this method.

Thanks Suva! I was thinking “_observable” meant something else entirely, like certain properties couldn’t be used yet or something about polling the property, which polling the property I guess is essentially what “_observable” is doing.

I’ve been trying to figure out what is wrong with my code here.

This one just seems to need a boolean in those last parentheses but I don’t know what to give it.

add_action {   
pattern = "/transport/edit",   
description = "Start Editing(boolean)",  
handler = function()  
renoise.song().transport.edit_mode()  
end,  
}  
  

this one has a bunch of problems, one is with variable declaration and another is something about getmetatable(_G)

  
add_action {   
 pattern = "/transport/edit_step",   
 arguments = { argument("edit_step_value", "number") },   
 description = "Set the songs edit step [0-64]",  
 handler = function(bpm)  
 renoise.song().transport.edit_step = clamp_value(edit_step, 0, 64)  
 end,  
}   
  

What I’m trying to do here is put an awesome amount of entries into the OSC prefs pane, and these seemed simple enough to get my head around. Starting with the renoise.Transport Properties in Renoise.Song.api.txt.

But, running into trouble with variable declarations and that boolean. I figured if I can start closer to home where things still make sense to me. :D I can start beginning to understand this stuff.

No, it’s not neccesary at all.

The example was deliberate, to highlight that the OSC Prefs / defaults are just Lua code, and you can do it from either end of the network.

renoise.song().transport.edit_mode = true
– or
renoise.song().transport.edit_mode = false

handler = function(edit_step) <–
renoise.song().transport.edit_step = clamp_value(edit_step, 0, 64)
end

Try out such code in the console first. Then you can be a bit more safe that it does the right thing when using this as OSC message.

Oh, and I hope you have seen the note on the very top of the GlobalOscActions.lua file (Copy the file!).


You don’t have to touch the “GlobalOscActions.lua” at all when using “evaluate”.

Or simply try out what you want to do in the console, then send this piece of code as argument to “evaluate”:

Like in conners example

  
$m = new OSCMessage("/renoise/evaluate", array(  
 'renoise.song().transport.bpm = 500'  
 ));  
  
  
  
renoise.song().transport.bpm = 500  
  

is what you can test in Renoises scripting console…

Disadvantage is that you then can not use extra arguments (like the new bpm). You have to add this to the string you are going to send tpo “evaluate”.

Is an address space of all the messages the OSC server can accept documented anywhere?