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?
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
returnin 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
mymoveto SuperColliderShould it work like that?