-
Notifications
You must be signed in to change notification settings - Fork 117
problem with server and client #129
Copy link
Copy link
Open
Description
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:
- receive a message from MAX via OSC
- elaborate the message in python
- send the elaborated message to SuperCollider via OSC
What is not clear to me is what concerns points 1 and 3
PART 0
import methods
from pythonosc import dispatcher
from pythonosc import osc_server
from pythonosc import udp_client
PART 1
setup a simple server for point 1, since I am only receiving one string at a time from MAX:
def listen2Max(ip,port):
'''
set up server
'''
# dispatcher to receive message
dispatcher = dispatcher.Dispatcher()
dispatcher.map("/filter", print)
# server to listen
server = osc_server.ThreadingOSCUDPServer((ip,port), dispatcher)
print("Serving on {}".format(server.server_address))
server.serve_forever()
but i do not know what to return in this function, also I do not get the use of "/filter" in the map. Is it something that must be specified in MAX?
PART 2
elaborate message with python
some python code that returns mymove
PART 3
set up a simple client to communicate the string var mymove to SuperCollider
def talk2SC(ip,port,mymove):
'''
set up client
'''
client = udp_client.SimpleUDPClient(ip,port)
client.send_message("/filter", mymove)
Should it work like that?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels