Skip to main content

OpenSoundControl message router over TCP

Project description

OSC routing over TCP

An OpenSoundControl message router over TCP written in Python designed with SuperCollider in mind.

Connect multiple SuperCollider instances over the internet and exchange messages between them.

While tcposcrouter was developed with SuperCollider in mind, it is possible to use it with any other software that supports OSC over TCP.

OSC specification

tcposcrouter supports both spec-1.0 and spec-1.1 in regards to framing the messages for sending over TCP stream.

See https://forum.renoise.com/t/osc-via-tcp-has-no-framing/42459 for an technical explanation.

SuperCollider implements OSC spec-1.0 while PureData implements spec-1.1 (with mrpeach external). See the examples folder for examples in both SuperCollider and PureData.

tcposcrouter will open two ports by default, one for each spec version, but the internal routing/user/group state is shared between them.

Installing

You will need Python >= 3.7 together with python-osc python library.

Easiest way to install is to get it from PyPI:

$ pip install tcposcrouter

Running

$  tcposcrouter -h
usage: tcposcrouter [-h] [--osc-port OSC_PORT] [--osc11-port OSC11_PORT] [--disable-osc10] [--disable-osc11] [--log-dir LOG_DIR]

Run the tcposcrouter server.

optional arguments:
  -h, --help            show this help message and exit
  --osc-port OSC_PORT   OSC port to listen
  --osc11-port OSC11_PORT
                        OSC port to listen using SLIP encoding
  --disable-osc10       Disables data length prefix (OSC spec-1.0)
  --disable-osc11       Disables SLIP encoding (OSC spec-1.1)
  --log-dir LOG_DIR     Path where to save logs

By default it listens for OSC spec-1.0 on the 55555 TCP and spec-1.1 on 55556 port.

Client

For a client example please check the SuperCollider class at:

https://github.com/aiberlin/HyperDisCo/blob/master/Classes/OSCRouterClient.sc

A client should send an OSC message to the server following the format:

/oscrouter/register,ssssi,userName,userPassword,groupName,groupPassword

The ssssi is the OSC format to tell that the arguments are 4 strings and 1 integer.

On a successful authentication the server will reply with the following message:

/oscrouter/register/userName

The userName is created with the given userPassword inside the given groupName.

For both the userName and groupName if one already exists the server will try to authenticate with the correspondent password, or fail if the password doesn't match.

Once the user is authenticated in a group (the /oscrouter/register message is sent back), you can start sending messages to the server. Any messages sent to the server from that point will be forwarded to all the users in the same group.

It is also possible to send private messages by sending a message like:

/oscrouter/private,ss,userName,address

Followed by as many arguments as you want. So /oscrouter/private,ssifs,userName,address,10,123.30,hello is a valid private message.

Your client will receive private messages in the /oscrouter/private address as well. For every user leaving or joining the group the client also receives the current list of users as /oscrouter/userlist.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tcposcrouter-0.2.0.linux-x86_64.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tcposcrouter-0.2.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file tcposcrouter-0.2.0.linux-x86_64.tar.gz.

File metadata

  • Download URL: tcposcrouter-0.2.0.linux-x86_64.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for tcposcrouter-0.2.0.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 55d3fb74dff01221e0ad61c33fa27d8b818b25597915f13659b4e65be8a2c965
MD5 4a70cb801b504dc27e31ef33e1b3099e
BLAKE2b-256 c241814dc8f7aa34dc8693c128baf21b27d3ff4d3fafe71f2348ca187a25ca4c

See more details on using hashes here.

File details

Details for the file tcposcrouter-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tcposcrouter-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for tcposcrouter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f4634a7ccbaf88411dad696606733e27512d1adbc0b4080f83c0810eb3feab1
MD5 33a1af3ecc5afd05bbd31eff59abdc69
BLAKE2b-256 9eb043b9dbc5d89165dee8aead3ae7abdbc3016c482e2ff2c74f625eb50b8136

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page