21 lines
649 B
Python
21 lines
649 B
Python
from pythonosc.dispatcher import Dispatcher
|
|
from pythonosc.osc_server import BlockingOSCUDPServer
|
|
|
|
# Fallback handler: will catch any OSC address not explicitly mapped
|
|
def default_handler(address, *args):
|
|
print(f"[RECEIVED] Address: {address}, Args: {args}")
|
|
|
|
def main():
|
|
ip = "0.0.0.0" # Listen on all interfaces
|
|
port = 5005 # Set to the same port as the sender
|
|
|
|
dispatcher = Dispatcher()
|
|
dispatcher.set_default_handler(default_handler)
|
|
|
|
server = BlockingOSCUDPServer((ip, port), dispatcher)
|
|
print(f"Listening for OSC messages on {ip}:{port}...")
|
|
server.serve_forever()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|