Hello everyone!
I would like to implement an OSC server on myrobotlab. I wanted to use the java oscP5 library in the jython service.
So far I tried to put the .java files frome the src folder of oscP5 to the src folder of myrobotlab.
And the .jar frome the library to the repo. Is it supposed to work?
Thank you for your time.
Here is the link to the library:
http://www.sojamo.de/libraries/oscP5/
Hello and Welcome nicolas
Hello and Welcome nicolas taguet !
It depends on how you want it to run.
Regular User Way
java -jar myrobotlab.jar -install
java -jar myrobotlab.jar
It worked this way for me
But I didn't have a cool musical instrument to send the data .. just netcat listening on port 8000
You have to be careful the Python tab needs to be selected (in focus) to run .. I always forget this and just press run and nothing happens ... I think someone will fix it next release ..
Run It As A Developer
So if you want to make a MRL Service or hack on some Java code - you add just the jar to the repo, adjust the class path, and begin creating your service. This would be like a wrapper to the OscP5 library. Probably not want you do until you get some experience playing with it as a user. But if do want to go that way you can google for related links.
Cheers - please post your project (pictures are always appreciated) when you get time !
Thank you a lot Grog!
Thank you for yout awesome answer i will do that.
Just as a brief presentation of the project I work as an intern in an audio visual compagny and they want to control on stage some of the inmoov robot's part via OSC... so here i am!
I will post the project and some picture once done.
Cheers!
Hello again! So i figured it
Hello again!
So i figured it out thanks to you!
I have a problem on the displaying of the incomming messages.
Here is how it is supposed to work to handle incomming messages, you define a method that is to be called on the receiving from the specified source (ip, adress and port).
Here is my problem, the udpServer works it is listening on right port, but i don't know how to display it on myrobotlab. Here is my code so far :
Edit listener
Hello again, i have an update, so i tried different libraries the OSC sending part is worky on all of them, but I can't get the receiving part to work. I am almost certain that the listeners handling the call of function at the reception of messages are not worky.
Is there something specific to myrobotlab you are supposed to do to get the listeners to work?
The listener in the library i'm using are started in threads, is it supported in myrobotlab?
Cheers!
Threads are supported, in
Threads are supported, in fact MRL is "massively" multi-threaded ..
Never worked with this library before, what are the requirements of a "Listener" ?
There is the possiblity that we make an official "Service" for this library ...
The purpose of many of the services is provide a wrapper of easy functionality, which works in the same framework as all the other services. I'd be willing to do this, but it would be helpful to get a good comment or post of references of what you can do with this library.
Do you think you can make a comment which has a list & pictures of the "potentially" nifty things to control or get data back from ?
If we make a service we might even make a gui (or 2) for it - what things would be useful in the gui ? Does it have a gui ?
potentially nifty things using OSC
OSC
OSC stands for Opend Sound Control. OSC is a protocol of communication that usually goes over ethernet.
It was mainly invented for the communication of electronical instrument such as synthetizers and controller. Also a lot of today's musical software are using OSC to send their data. Here are its features from wikipedia:
For example this guys are implementing/using OSC to send/process data :
OSC controller
touchOSC
Processing
There is a more exhaustive list of wikipedia :
https://en.wikipedia.org/wiki/Open_Sound_Control#Applications
For more information here is pdf giving some of the OSC specificity in regard with MIDI
http://opensoundcontrol.org/files/OSC-Demo.pdf
Implementation with javaOSC
In order to implement OSC in myrobotlab and join the osc family the library called javaOSC could be used
It has a gui :
It is easy to use, choose:
For the server part i don't know how it is supported in this case.
But a gui supporting the server port could be neat with these functions:
Finally here is a link to project done thanks to OSC:
http://opensoundcontrol.org/osc-application-areas
I hope this post gave the information you wanted Grog, thank you for all the support!
Cheers!
This is great ! ... very
This is great ! ... very useful.
I'm now in the process of creating a MRL Service Osc.
I saw there were a couple of choices for interface libraries. Initially I started looking at JavaOsc .. OscP5 is "made" specifically for Processing. However, JavaOsc latest does not compile with Java 8. Although this could be fixed relatively quickly, it made me look more closely at OscP5. I believe its a well written library, and it does not appear to have any Processing dependencies.
So .. the MRL Osc service will be a wrapper for OscP5 ..
At least that is the current plan...
That just said... I just
That just said... I just discovered the following in OscP5 libarary
I've looked at P5 libraries before, and see they reference P5's PApplet. I was hoping this library did not - but it does in a different way. It dynamically references PApplet. And this is why the receiving data is borked. I could create a new constructor with an input string which would make things work, then submit the addition back to the OscP5 group ... but maybe not...
So, Althought this library is written well, it would require me hacking on it to make it work completely in MRL. So now I'm switching to plan B .. "try using JavaOsc"
Now on the JavaOSC side
Now on the JavaOSC side ...
He doesn't publish any binary releases.. he has several tagged source versions & a binary in sourceforget (cept I'm not sure of the version there...)
I've decided just to look into the source to see if I can get something to work satisfactorily - I'm going to try his "develop" branch latest checkout, because the latest is usually the best ..
If I get something to work, I'll bundle it as a library and put it in the repo
Hello, sorry to bother you
Hello, sorry to bother you with that but is the github up to date? I followed the quick start tuto (well written btw)
and i'm not sure it is the same version as the last build. Here is the link : http://myrobotlab.org/quick_start
Also is there a branch we have to clone rather than another?
Cheers!
"develop" ! is the one to
"develop" ! is the one to use ... we are working on a release - the project page is here https://github.com/orgs/MyRobotLab/projects/1 - if you don't have a GitHub account you'll not be able to see the project page (404 is returned)
Make sure you load the repo project .. otherwise everything will be all red with errors ;)
Thank you Kwatters
Ok awesome thank you a lot!
I'll be able to put my lil' hand in all that code!
yours happy to work on this project.
I do have an account.
Hello Grog,
I do have an account and i still get page not found with the error 404.
Is there something special i am supposed on my account to be able to access it?
JavaOSC source from github
JavaOSC source from github with develop branch (origin) compiles fine ... its just the maven build project and/or tests which fail to create the binary ...
Testing functionality, I started the UI and did the same netcat -ul -p 57110 ..
A little strange the port is hardcoded .. it sent udp messages
There is some docs to set up a receiver .. but the docs of course are way out of date, and do not compile ...
might be able to figure it out...
Can't help look at the
Can't help look at the history of JavaOSC - I think originally it was created to interface with SuperCollider - http://supercollider.github.io/
Never heard of it .. looks like an IDE - audio dsp sound studio with an interpretive scripting interface. Downloaded it and installed it for fun .. but looks like a very steep learning curve ...
Hello Grog when do you sleep!
Hello!
I see that it was a tough day of work!
I finally succeeded to set up the receiver.
Here it is:
Wow .. really
Wow .. really nice..
Impressive Python "class" / Java declaration ..
I'm glad you figured it out ... I'd like to finish this myrobotlab Osc service and make it easier for others - because that's what we do ;)
I'll finish it, and give an example of how to use it in Python, then perhaps you could test and give some suggestions..
... goodtimes ...
Hmmmm... OSCPortIn.addListene
Hmmmm... OSCPortIn.addListener does not exist in the version I have (latest on develop) ... going to try the "released" jar
It seems they have removed addListener, and created a different class for handling the filtering called OSCPatternAddressMessageSelector - but I see no example of how to properly use it ...
I hope it helped to do the service
Hello, thank you for the work acknowledgement :)!
I hoped that my codes could help you write the service, i have to admit that i don't know anything about how your services really work and how you write your Gui and myrobotlab as whole but it'll come when i'll read through the code!
I can give you the version of javaOSC i got.
I'm now working on a heartbeat sending through osc (got it to work) and soon i'll have two code to control the inmoov robot from an osc sender (myrobotlab or not) to myrobotlab.
I comment everything and i'll post it here soon.
https://mvnrepository.com/artifact/com.illposed.osc/javaosc-parent/0.4
You gave me a reference to
You gave me a reference to the maven repository....
Usually they have artifacts here ..
So I copied the dependency xml and put it in a minimal maven pom
then ...
mvn dependency:copy-dependencies
That should have copied the jar to a folder, I could then check into the "repo"
But instead it gave me errors that it couldn't resolve.
I looked at the maven page... and sure enough - there is no binary jar checked in !!!
I could check out the 0.4 tag in github and build it, but I'm wondering why you gave me this link, and if it worked for you .. perhaps in some other way ?\
I hope it helped to do the service
This is the tentaive
This is the tentaive interface in Java ... but basically it would be the same in Python, but less code ;)
Was thinking of having an
osc.connect("somehost", 7777)
then all subsequent would be osc.send("/path", var, args, 123, "hello"), that way the "somehost", 7777 would not need to be specified on every call ... still might do it, the only thing which gave me pause was the fact its udp protocol underneath - which is "connectionless" - so connect might be a little deceiving
Ah .. here it
Ah .. here it is...
https://mvnrepository.com/artifact/com.illposed.osc/javaosc-core/0.4
Ok, I got listen to work by
Ok, I got listen to work by connecting 2 Osc services together ...
Some stuff I've learned:
[[service/Osc.py]]
The OSCMessage vs Osc is bothersome, but OSCMessage is a class from the original JavaOSC. In Mrl .. all abbreviations follow the same capitalization rules. Its camelcase for everything as Java traditionally is. But we try to follow a strict policy of capitalizing "only" the first letter of abbreviations too. So camelCase makes abbreviation look like words. I think its easier to read too.For example it would be XmlParser vs XMLParser.
I'm very close to refactoring and creating a new Mrl class called OscMessage where it will contain the same contents (and perhaps more) of the OSCMessage - probably should do that sooner than later, otherwise risk breaking peoples python scripts.Refactoring done, there is a static inner class named OscMessage - all interface methods or data is now done with Mrl standard Osc
O.K. just tested it and "/*" looks like it might do what I would expect - found some helpful examples of addressing here - http://opensoundcontrol.org/spec-1_0-examples#OSCaddress
osc.sendMsg("/somewhere/else", "this", "is", 7, 3.3, "variable arguments")
not sure if it did not receive or could not send.
I think there might be be a
I think there might be be a bug in JavaOSC - where any address which is mutiple levels like
/test/data/1
is not received by listening to /*
/test
generates a event - but /test/data/1 does not
And the service is already on it's way
Hello, sorry for the absence this WE i had some family matters i had to attend to!
Sorry also for the wrong link...
Good idea to do the refactoring, feels cleaner now :).
Is /*/* working? If "/" is an escaping character it might be it... Even if it would be strange if it is trying to match strings thanks to regular expressions.