@@ -36,21 +36,24 @@ OscReceiver oscReceiver;
3636OscSender oscSender;
3737int localPort = 8888 ;
3838int remotePort = 9999 ;
39- const char * remoteIp = " 127.0.0 .1" ;
39+ const char * remoteIp = " 192.168.7 .1" ;
4040
4141// parse messages received by the OSC receiver
4242// msg is Message class of oscpkt: http://gruntthepeon.free.fr/oscpkt/
4343bool handshakeReceived;
4444void on_receive (oscpkt::Message* msg, void * arg)
4545{
46- if (msg->match (" /bela/ osc-setup-reply" ))
46+ if (msg->match (" /osc-setup-reply" ))
4747 handshakeReceived = true ;
48- else if (msg->match (" /bela/ osc-test" )){
48+ else if (msg->match (" /osc-test" )){
4949 int intArg;
50- float floatArg;
51- msg->match (" /bela/osc-test" ).popInt32 (intArg).popFloat (floatArg).isOkNoMoreArgs ();
52- printf (" received a message with int %i and float %f\n " , intArg, floatArg);
53- oscSender.newMessage (" /bela/osc-acknowledge" ).add (intArg).add (4 .2f ).add (std::string (" OSC message received" )).send ();
50+ // float floatArg;
51+ msg->match (" /osc-test" ).popInt32 (intArg).isOkNoMoreArgs ();
52+ printf (" %i\n " ,intArg);
53+ // msg->match("/osc-test").popInt32(intArg).popFloat(floatArg).isOkNoMoreArgs();
54+ // int intArg;
55+ // printf("received a message with int %i and float %f\n", intArg, floatArg);
56+ // oscSender.newMessage("/osc-acknowledge").add(intArg).add(4.2f).add(std::string("OSC message received")).send();
5457 }
5558}
5659
@@ -61,9 +64,9 @@ bool setup(BelaContext *context, void *userData)
6164
6265 // the following code sends an OSC message to address /osc-setup
6366 // then waits 1 second for a reply on /osc-setup-reply
64- oscSender.newMessage (" /bela/ osc-setup" ).send ();
67+ oscSender.newMessage (" /osc-setup" ).send ();
6568 int count = 0 ;
66- int timeoutCount = 10 ;
69+ int timeoutCount = 5 ;
6770 printf (" Waiting for handshake ....\n " );
6871 while (!handshakeReceived && ++count != timeoutCount)
6972 {
0 commit comments