Skip to content

Handler of incoming OSC messages in sever.py causes errors #3

Description

@pikseliahky

The handler parses the message incorrectly. OSC messages are sent as flat sequence so there are no positional vs keyword arguments. In order for the OSC messaging (e.g. from SuperCollider) to work, this change solved the problem. I am not a Python coder, so not sure if this does not break something else though, but this works:

@osc.handle('/notochord/feed_query', return_port=send_port)
    def _(address, *args, **kw):
        if not kw and len(args) % 2 == 0:
            it = iter(args)
            kw = dict(zip(it, it))
            args = []

        print(f"{address} {args=} {kw=}")
        r = predictor.feed_query(*args, **kw)
        return (
            '/return/notochord/query',
            *[x for pair in r.items() for x in pair])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions