Hey,
i´m trying to understand the OSC syntax of the osc library ( http://gruntthepeon.free.fr/oscpkt/html/index.html) on a ASCII String / HEX level to create a parser for another environment which cant have a OSC lib right now.
for testing I have the app, Packet Sender ( https://packetsender.com/ ) and as comparison;´: when receiving data from MAX CNMAT a ASCII string looks like this eg.:
#bundle\00\00\00\00\00\00\00\00\01\00\00\00\0c/voices\00,\00\00\00
right now I cant receive anything from Bela in the local PacketSender app.
so far PacketSender was the most reliable network monitor software to me.
it should be easy. is there anything I´m missing or do you know another way for finding out the osc syntax of the oscpkt lib?
#include <Bela.h>
#include <libraries/OscSender/OscSender.h>
#include <libraries/OscReceiver/OscReceiver.h>
OscReceiver oscReceiver;
OscSender oscSender;
int localPort = 7562;
const char* remoteIp = "192.168.2.125"; //
int remotePort = 51909; // this port is shown by PacketSender
// parse messages received by the OSC receiver
// msg is Message class of oscpkt: http://gruntthepeon.free.fr/oscpkt/
void on_receive(oscpkt::Message* msg, const char* addr, void* arg)
{
printf("From %s\n", addr);
if(msg->match("/voices"))
{
//int intArg;
//float floatArg;
//printf("received a message with int %i and float %f\n", intArg, floatArg);
}
}
bool setup(BelaContext *context, void *userData)
{
oscReceiver.setup(localPort, on_receive);
oscSender.setup(remotePort, remoteIp);
// test message
oscSender.newMessage("/osc-acknowledge").add(4.2f).add(std::string("OSC message received")).send();
return true;
}
void render(BelaContext *context, void *userData)
{
// test message
oscSender.newMessage("/osc-acknowledge").add(4.2f).add(std::string("OSC message received")).send();
}
void cleanup(BelaContext *context, void *userData)
{
}