1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #include <OSCBundle.h>
- void setup() {
- Serial.begin(38400);
- }
- void loop(){
-
- OSCMessage msg0("/{input,output}/[0-2]/[!ab]/*");
-
-
- int patternOffset = msg0.match("/input/1");
- if (patternOffset>0){
-
-
- if(msg0.fullMatch("/c/anything", patternOffset)){
- Serial.println("Match: '/input/1/c/anything' against the pattern '/{input,output}/[0-2]/[abc]/*'");
- }
- }
-
- OSCMessage msg1("/partialMatch");
-
- if(!msg1.match("/partial")){
- Serial.println("No Match: '/partial' against the pattern '/partialMatch'");
- }
- OSCMessage msg2("/output/[0-2]");
-
-
- msg2.route("/output", routeOutput);
-
-
- msg2.dispatch("/output/1", routeOutputOne);
- delay(1000);
- }
- void routeOutput(OSCMessage &msg, int patternOffset){
- Serial.println("Match: '/output'");
-
- msg.route("/0", routeZero, patternOffset);
- }
- void routeZero(OSCMessage &msg, int addressOffset){
- Serial.println("Match: '/output/0'");
- }
- void routeOutputOne(OSCMessage &msg){
- Serial.println("Match: '/output/1'");
- }
|