OSC Server#
API#
The OSC server handles the backend communication from SuperCollider. As OSC useses UDP and it is designed in an async manner we have to send back any result from SuperCollider via a new OSC message. As Django does not natively understand UDP messages and OSC is a rather restrictive protocol we created this server which is able to receive this messages and makes it available to our Django app by using its ORM.
Each SuperCollider instance sends a beacon in order to get discovered by the backend as a
StreamPoint
.
This is not a Django app but an application on its own.
Todo
A long term goal would be to include this into the Django process but it seems gunicorn only runs when a request hits, making the necessary polling for received messages not working properly.
Server#
A naive server to receive OSC messages from SuperCollider.
- class osc_server.server.OSCServer[source]#
Uses pythonosc to map the routes
# route
method
message
/beacon
/acknowledge_handler
/remote/action
- acknowledge_handler(client_address, address, *osc_args)[source]#
Acknowledges a message and updates its associated
StreamInstruction
.- Return type:
- beacon_handler(client_address, address, *osc_args)[source]#
Accepts a beacon from SuperCollider and creates a
StreamPoint
from it so it gets discovered by the backend.- Return type:
- remote_action_handler(client_address, address, *osc_args)[source]#
Remote actions are used to trigger actions on a SuperCollider instance and can be send in form of a
StreamInstruction
or raw from a local running SuperCollider instance which can be used to live code the SuperCollider instances managed by Gencaster.- Return type:
Models#
Allows to use some static type checks for messages receiving from SuperCollider.
OSCAuthMixin#
Allows to validate a given password for backends. |
||
type |
object |
|
properties |
||
|
Password |
|
type |
string |
SCAcknowledgeMessage#
See |
||
type |
object |
|
properties |
||
|
Uuid |
|
UUID from |
||
type |
string |
|
|
#/definitions/GenCasterStatusEnum |
|
|
Return Value |
|
Allows to store a return value in the database if given. |
||
type |
string |
|
definitions |
||
|
GenCasterStatusEnum |
|
Status of our callback. |
||
type |
string |
|
enum |
SUCCESS, FAILURE, READY, FINISHED, BEACON, RECEIVED |
SCBeaconMessage#
Will create a |
||
type |
object |
|
properties |
||
|
Name |
|
type |
string |
|
|
Synth Port |
|
type |
integer |
|
|
Lang Port |
|
type |
integer |
|
|
Janus Out Port |
|
type |
integer |
|
|
Janus In Port |
|
type |
integer |
|
|
Janus Out Room |
|
type |
integer |
|
|
Janus In Room |
|
type |
integer |
|
|
Janus Public Ip |
|
type |
string |
|
|
Use Input |
|
type |
boolean |
|
|
Osc Backend Host |
|
type |
string |
|
|
Osc Backend Port |
|
type |
integer |
RemoteActionMessage#
Sends message to SuperCollider cluster. |
||
type |
object |
|
properties |
||
|
Password |
|
type |
string |
|
|
#/definitions/RemoteActionType |
|
|
Cmd |
|
type |
string |
|
|
Target |
|
type |
string |
|
|
Protocol Version |
|
Can be used to upgrade our communication by rejecting older clients/messages |
||
type |
string |
|
definitions |
||
|
RemoteActionType |
|
Requests an action on SuperCollider instance. |
||
type |
string |
|
enum |
code, speak |