Osc Discussion (How Where What To Use Osc)

That’s amazing! Is this all direct api communication through the http server between the javascript and renoise??

All I can tell in the html source is there is a TON of confusing stuff going on in the js. :D

Be careful Bantai, it’s said there is a fine line between genius and insanity. :P

wow.

Well, I’ve been trying to send OSC from renoise with no luck so far.

But here is a small processing sketch that controls the volume on the first track, it’s half nicked from the pd sketch earlier.
If anyone’s interested, you need the oscp5 library.

import oscP5.;
import netP5.
;
float wow = 0;
float count = 0.1;

NetAddress myRemoteLocation;
void setup() {
size(200,200);
frameRate(25);
noStroke();
myRemoteLocation = new NetAddress(“127.0.0.1”,8000);
}

void draw() {
rect(10,10,10,10);

background(0);
wow += count;

if (wow > 1.4) {count = -0.1;}
if (wow < 0) {count = 0.1;}

fill(250);
ellipse(width/2,height/2,wow40,wow40);

/* create a new OscMessage with an address pattern, in this case /test. */
OscMessage myOscMessage = new OscMessage("/renoise/evaluate");

/* add a value (an integer) to the OscMessage */
myOscMessage.add(“renoise.song().tracks[1].prefx_volume.value =”+wow);

/* send the OscMessage to the remote location.
*/
OscP5.flush(myOscMessage,myRemoteLocation);
print(wow);
}

processing is real cool, are you using an Arduino with it?

I am not. Primarily because I don’t have an arduino.
But that is a good idea, you know. I’ve alway wanted an arduino controlled servo that would click and bang against things. I hadn’t thought I could sync it with renoise.

I’m just going to ask this, because I’ve been looking through things, and don’t understand:

Does anyone know how to send the value from a signal follower on track 1?

Two ways depending on where the SF device currently is:
1:If you swap track one with the track that contains the signal follower
2:If you position the SF device in front of the device that you want to automate.

Point 2 is mandatory for the SF:the controlled device always have to be somewhere to the right of the SF… either the same track or one of the next tracks.

:D I don’t know if it’s possible.

Sending something from renoise seems to require inventing a tool that creates a client.
I don’t think there was much discussion of OSC usage while it was being implemented. :expressionless:

I think they want us to use midi.

Ah Thanks vV, but I wasn’t very clear. I want to send the signal follower value in OSC to another application (processing, but I think I can handle that part)
Copying and pasting from OSCsnippets, I’ve tried something along the lines of this:

[LUA]-- Osc client & message construction (send Osc to a server)

– open a socket connection to the server
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

– construct and send messages

client:send(
OscMessage(“/someone/signal”)
handler = function()
renoise.song().tracks[1].devices[3].parameters[1].value
)
[/LUA]

(where track one has two devices on it, a SF, and a Hydra that recieves the SF)
but no luck, actually I can’t get any OSC signals to send from renoise. no start or stop or whatever.

Try this from testpad.lua to get you started.
It will send an osc message once when you hit execute.

  
-- create some handy shortcuts  
local OscMessage = renoise.Osc.Message  
local OscBundle = renoise.Osc.Bundle  
  
-- Osc client & message construction (send Osc to a server)  
  
-- open a socket connection to the server  
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  
  
-- construct and send messages  
client:send(  
 OscMessage("/test/this", {   
 {tag="f", value=127.5}   
 })  
)  
  

would something like this work?

  
local OscMessage = renoise.Osc.Message  
local OscBundle = renoise.Osc.Bundle  
local workdamnit = renoise.song().tracks[1].devices[1].parameters[1].value  
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  
  
-- construct and send messages  
client:send(  
 OscMessage("/1/sliderA", {   
 {tag="i", value = workdamnit}   
})  
)  
end  
  

I keep getting an ‘’

YES!
Thanks Sambiotic. For some reason, it didn’t work when both programs (renoise and processing) were on port 8008, or 8000, but 12000 worked.

EDIT: I was being thick, of course two programs can’t listen/send through the same port.

anyone know anything about a javascript library for OSC?

seriously, Moonriders, have you even tried an internet search?

http://cnmat.berkeley.edu/patch/2950
https://trac.v2.nl/log/metaosc/trunk/meta-osc.js?rev=5415

This is all that I’ve found so far with the exception of something I found that I’m not sure how it works yet, just stuff that links with max. so that could be actually helpful to you.

Don’t worry, I do not rely on anyone here.

except the team of course. :D

why I was asking about javascript is because I started working on a SVG interface 2 nights ago:
http://5380828107659884056-a-1802744773732722657-s-sites.googlegroups.com/site/renoisessvgsliderarray/rsa/2gsitetest.svg

This shows up properly in Opera, the colors are off in Chrome, and it’s all messed up in firefox.
That’s why I was asking about javascript.

Flash is crossbrowser, has an API for OSC (flosc), and many features for UI design. Definitely a worthwhile alternative to javascript/SVG

Flash is out, I never really liked it anyway.
No one in there right mind would have clicked that link, knowing it was Flash. :P

So, it’s either SVG or Canvas at this point, I understand SVG better, Canvas is cool too.
SVG is pretty simple, and it shows. Canvas looks to be all in the javascript, and while Canvas can do some really beautiful stuff it gets real heavy of the processors.
I was going to start a thread about it yesterday night “SVG vs Canvas”, but it seems a few? people are getting agitated with my personality lately so I went it alone. I’m pretty sure I know what’s messing up firefox with my little slider thing, it’s probably because I didn’t use hex colors.
I want to do some big versions of this for like multi-touch tablets and tables for when I can afford one.
But yeah flash is definitely out of the question.
I’m pretty sure I can re-purpose the javascript in those 2 links to work with renoise, just have to figure out how it’s interfacing with max first. ;)

shows up in FF and chrome now.
http://5380828107659884056-a-1802744773732722657-s-sites.googlegroups.com/site/renoisessvgsliderarray/rsa/2gsitetest.svg
is was the colors.
if anyone is running something like NoScript in FF, the SVG is linking to http://www.carto.net/ for the js files, as I haven’t found a way to link the js files directly inside google sites.

If anyone else wants to try using SVG for interface building
I got everything for this project at http://www.carto.net/
http://www.carto.net/svg/gui/slider/
http://www.carto.net/papers/svg/gui/button/

the javascript api you are looking at is maxMsp specific just like the lua api we are all using is renoise specific.
http://cycling74.com/docs/max5/vignettes/js/javascriptinmax.html

Could someone please explain why this code sends the previous bpm value over osc and not the current?

edit is send osc too much for a notifier function? – Be gentle and don’t do CPU heavy stuff in your notifier!

  
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/bpm", {   
 {tag="f", value=renoise.song().transport.bpm}   
 })  
 )  
end  
  
function attach_to_song()   
 renoise.song().transport.bpm_observable:add_notifier(  
 send_osc  
 )  
end  
  
renoise.tool().app_new_document_observable:add_notifier(  
 attach_to_song  
)   
  

Looks like a bug in bpm_observable. Will take a look into this…

No, that’s definitely not the problem.