Skip to content

how make an osc response from the server #169

Open
@systemeFriche

Description

@systemeFriche

I want to simulate a Beringher X32 mixing table with a python program. The idea is to command a max program with the X32 Edit software.
To initiate the communication between the X32 Edit software and my fake X32 program, I need the server to respond to the client with an OSC message, something like that :

def xinfo(unused_addr, args):
    server.answer('/xinfo', [X32_OSC_ADDRESS, 'X32-04-A0-71', 'X32', '4.06'])


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip",
                        default=X32_OSC_ADDRESS, help="The ip to listen on")
    parser.add_argument("--port",
                        type=int, default=X32_OSC_PORT, help="The port to listen on")
    args = parser.parse_args()

    dispatcher = Dispatcher()
    dispatcher.map("/xinfo", xinfo, "xinfo")

    server = OSCUDPServer((args.ip, args.port), dispatcher)

    print("Serving on {}".format(server.server_address))
    server.serve_forever()

Is it possible with python-osc module ? How ?
Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions