-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem with server and client #129
Comments
What you want is basically an OSC "proxy", so you need to set up listening for max input first, set up your forwarding client next, then plug the twos together. I recommend reading the OSC spec (https://zenodo.org/record/1177517) to familiarize yourself with the concepts. |
Cool, thanks. I will read the document :) As to 1: usually I have something like
What is this part with the client? |
Glad this was helpful. |
Thanks! I do not want to take advantage of your helpfulness but if I was to use a single function as described here
What would be the variable "containing" the message? Something like |
The |
Ok, got it and the server part works like a charm! Now, any suggestions on how to plug the server and client? I suppose, I should not use the same port. |
You can pick whatever you want for your client port, best to make it configurable by users using an environment variable or a flag but that's up to you. |
Great! I did it ;) You are my hero now, know it :) is there a way to ship the ip address along with the function call in something like I tried to rescue the ip from within
with no luck Also, I did not get how to pass arguments to |
Sure thing, dispatcher.map accepts an optional list of arguments at the end to pass static data like that: https://github.com/attwad/python-osc/blob/master/pythonosc/dispatcher.py#L70 So it should be: |
Ok, cool, got it! |
It seems like max has no URI path, or at least not one that I could find. Is there a way to make my server listen to each path on that port? |
You could use a default handler: https://github.com/attwad/python-osc/blob/master/pythonosc/dispatcher.py#L198 |
Ok, so at the moment I am passing my
inside the I see it requires a function as argument, which one? The EDIT: I think I know what you mean. The default handler could be used to get max's address right? |
Well, I tried to
Obviously, I am missing something. Here is my python code, I hope someone could help me understand what I am doing wrong.
|
I solved one of my problems: on max's side, string messages must be formatted as follows:
where filter is the URI path one chooses. If one does not want to have a fixed URI path one could choose to format messages on max like this:
and in python one would simply write in the parser:
Now, I need to figure out on which path supercollider will listen to python! |
I ended up sending and receiving messages with "pure" udp protocol to skip the address part Now I am fighting with OSC byte-type. Is there a function to
|
Sorry I'm not sure I follow anymore, if you end up dealing with OSC from raw UDP packets then you basically bypass what this library is about so I'm not sure how useful this is to you. |
I am using some of the functions of this library that are helping me in translating strings to osc objects and osc objects to strings! |
Ah ok, well you can look at the functions in https://github.com/attwad/python-osc/blob/master/pythonosc/parsing/osc_types.py#L49 for example but this is not really a use case supported by this library so you might not find exactly what you want here. |
Yes, I have seen it and used it. For the purpose of this open issue, I would "make a request": allow for raw UDP connection WITH OSC object transmission. This is what I have roughly done using a little bit of this library and a little bit of the socket library. For the infrastructure of this library, it shouldn't be too hard to add a server and a client type for raw udp connections...of course if it is in the scope of your work! |
FYI the existing client is a UDP client and there exists UDP servers as well: I am still unclear why you need to work on raw packets but if you think this is legitimate and could be useful to others then PRs are welcome :) |
Messages coming from MaxMSP are raw packets. Plus, my friend wasn't sure about how to set the address in Super Collider. Of course, everything is feasible both in MaxMSP and SuperCollider, but still I think it could be a good feature to make the address optional...but of course it is up to you ;) |
Yes messages transit "raw" over UDP sockets, that's why this library exists, to parse them. Perhaps those can help:
|
Thanks, |
I am a fairly experienced python user, but I have no experience with OSC protocol.
I am helping a friend in building a python code that should do the following:
What is not clear to me is what concerns points 1 and 3
PART 0
import methods
PART 1
setup a simple server for point 1, since I am only receiving one string at a time from MAX:
but i do not know what to
return
in this function, also I do not get the use of"/filter"
in themap
. Is it something that must be specified in MAX?PART 2
elaborate message with python
PART 3
set up a simple client to communicate the string var
mymove
to SuperColliderShould it work like that?
The text was updated successfully, but these errors were encountered: