oscP5 oscEvent get port data
in
Contributed Library Questions
•
2 years ago
I'm building an OSC monitor/patcher that has to be able to listen to mulitple ports.
As far as I found out that will be only possible by making multiple OscP5 objects that each listens to their own port. I've tested this with 2 ports and that works perfect.
However all objects call the oscEvent function. Is there a way to see which OscP5 object triggered the oscEvent function? Or to get more details from the OscMessage?
I've looked into the documentation the only thing I've found that came close was the OscMessage print() method.
This is what I its prints for a message send to port 8000:
-OscMessage----------
received from /192.168.0.101:63405
addrpattern /1/fader1
typetag f
[0] 0.30240548
And this for a message to port 3333:
-OscMessage----------
received from /192.168.0.104:50643
addrpattern /tuio/2Dcur
typetag si
[0] fseq
[1] 1330
The port is not similar it seems? The ip-adres is correct.
Questions:
As far as I found out that will be only possible by making multiple OscP5 objects that each listens to their own port. I've tested this with 2 ports and that works perfect.
However all objects call the oscEvent function. Is there a way to see which OscP5 object triggered the oscEvent function? Or to get more details from the OscMessage?
I've looked into the documentation the only thing I've found that came close was the OscMessage print() method.
This is what I its prints for a message send to port 8000:
-OscMessage----------
received from /192.168.0.101:63405
addrpattern /1/fader1
typetag f
[0] 0.30240548
And this for a message to port 3333:
-OscMessage----------
received from /192.168.0.104:50643
addrpattern /tuio/2Dcur
typetag si
[0] fseq
[1] 1330
The port is not similar it seems? The ip-adres is correct.
Questions:
- Can I get the port and/or the ip-adress from the message with a certain method?
- Is it smart to listen to multiple ports by making multiple OscP5 objects? Is there a certain limit of objects that can be run or is this just trial and error?
- I've understood that its is easy to send messages to different ports by using the Flush() method. Is that right? Or would using multiple netAdress objects be a better idea as stated in this example on the Processing forum.
1