i’ve updated it to include bundle support (only for sending - bundles are automatically and transparently unwrapped into their component messages on receive). i’ve also changed the hostname argument on setup() to a std::string (rather than a const char*). and, lastly, i’ve added a clear() method to ofxOscMessage so you can reuse the same message object when sending.
have a look at examples/oscSendExample/testApp.cpp for an example of bundle creation and sending - basically you just go like this:
ofxOscBundle b;
// make message
ofxOscMessage m;
m.setAddress( "/bundle1" );
m.addIntArg( 3 );
// add to bundle
b.addMessage( m );
// and repeat
m.clear();
m.setAddress( "/bundle2" );
m.addFloatArg( 5.5f );
// add to bundle
b.addMessage( m );
// make nested bundle
ofxOscBundle nested_b;
m.clear();
m.setAddress( "/bundle3a" );
m.addStringArg( "nested bundle test" );
nested_b.addMessage( m );
m.clear();
m.setAddress( "/bundle3b" );
m.addStringArg( "test2" );
nested_b.addMessage( m );
// add to outer bundle
b.addBundle( nested_b );
// send
osc_sender.sendBundle( b );
David and myself are currently hard at work on a follow-up piece (called Swarm) of our ‘Wixel Cloud’ light sculpture. Check out these links for info and experiments:
Swarm will be part of an interactive light-art exhibition in Eindhoven coming September. So our new wixel hardware is going to be fully assembled very soon and i’m eager to see the new OSC code at work!
hmm, should’ve put a watch on this thread, i somehow missed this feature request…
hold tight, 0.03 coming soon, with much more relaxed message parsing (no more assert() crashes if you try and get the wrong argument type - now it just coerces the input type to the requested type).
i’ve made it much more forgiving when there’s a type mismatch. before it threw an exception if you tried to get a float pointer as an int or vice versa - now it prints a warning to stderr and tries to convert to the proper format (even works for getting a float as a string).
the message.getAddress() now returns a string rather than a char* - this will cause existing code that uses strcmp( m.getAddress(), “pattern” ) to break, you’ll have to go strcmp( m.getAddress().c_str(), “pattern” ) instead, or just use m.getAddress() == “pattern” instead.
you can get the remote ip and port by calling m.getRemoteIp() (returns string) and m.getPort() (returns int).
Im still a bit new with OF and how to communicate between other platforms,
Im interested in working with MAX and OF since I havent seen much audio libraries in OF yet… but anyway my question is the following:
I tried to test the example of the ofxOsc but I couldnt … it shows a window with an error… just one error that drives me crazy:
if anybody knows why would be great
thanks for all!
Once the above is invoked, the following message ends up in the system console after a 5 - 10 second delay:
“OSC Problem: Bad size count 469762048 in bundle (only 28 bytes left in entire bundle).”
This seems like a very large bundle for a single integer? Is it possible that instead of sending the message just snowballs into a larger bundle explaining the delay before the error registers in the system console?
ofxOSC looks really amazing but I’m having the same problem as popa2k with CB on windows
I even tried a self-compiled lib from the last version of oscpack I found on the website but CB keeps failing during the linking!
yay, thks to David, i finally got it to work!
It looks like the osc addon i got with the 0.0573 (c::b windows) was not up to date. Maybe I put it myself, I can’t remember.
But anyway, for people having the same problem i had on windows, it should work just by replacing the osc folder with the one of frey’s website.
thks!