FoxDot.lib.ServerManager¶
Handles OSC messages being sent to SuperCollider.
- class FoxDot.lib.ServerManager.BidirectionalOSCServer(server_address=('localhost', 0), client=None, return_port=0)[source]¶
Bases:
OSCServerThis is a combination client/server
The UDP server is necessary for receiving responses from the SCLang server when we query it with requests.
Note that this is not thread-safe, as the receive() method can discard messages
- class FoxDot.lib.ServerManager.Message(data)[source]¶
Bases:
objectWrapper for JSON messages sent to the server
- class FoxDot.lib.ServerManager.OSCClientWrapper(server=None)[source]¶
Bases:
OSCClient- error_printed = True¶
- class FoxDot.lib.ServerManager.OSCConnect(address)[source]¶
Bases:
OSCClientWrapperAn OSCClientWrapper that connects on initialisation
- class FoxDot.lib.ServerManager.RequestHandler(request, client_address, server)[source]¶
Bases:
BaseRequestHandlerCreated whenever a new connection to the server is made: self.request = socket self.server = Server instance self.client_address = (address, port)
- master = None¶
- exception FoxDot.lib.ServerManager.RequestTimeout[source]¶
Bases:
ExceptionRaised if expecting a response from the server but received none
- class FoxDot.lib.ServerManager.SCLangServerManager(addr, osc_port, sclang_port)[source]¶
Bases:
ServerManager- boot()¶
Boots SuperCollider using subprocess.
- bufferRead(path, bufnum)[source]¶
Sends a message to SuperCollider to read an audio file into a buffer
- daemon: Popen[bytes] | None¶
- freeAllNodes()[source]¶
Triggers a free all message to kill all active nodes (sounds) in SuperCollider
- fxlist = None¶
- get_bundle(synthdef, packet, timestamp=0)[source]¶
Returns the OSC Bundle for a notew based on a Player’s SynthDef, and event and effects dictionaries
- get_midi_message(synthdef, packet, timestamp)[source]¶
Prepares an OSC message to trigger midi sent from SuperCollider
- property is_runnig¶
Checks if the SuperCollider IDE or SCLang is running.
- loadSynthDef(fn, cmd='/foxdot')[source]¶
Sends a message to the FoxDot class in SuperCollider to load a SynthDef from file
- prepare_effect(name, packet)[source]¶
Finds the child attributes in packet and returns an OSC style list
- sendMidi(msg, cmd='/foxdot_midi')[source]¶
Sends a message to the FoxDot class in SuperCollider to forward a MIDI message
- synthdefs = None¶
- class FoxDot.lib.ServerManager.ServerInfo(sample_rate, actual_sample_rate, num_synths, num_groups, num_audio_bus_channels, num_control_bus_channels, num_input_bus_channels, num_output_bus_channels, num_buffers, max_nodes, max_synth_defs)¶
Bases:
tuple- actual_sample_rate¶
Alias for field number 1
- max_nodes¶
Alias for field number 9
- max_synth_defs¶
Alias for field number 10
- num_audio_bus_channels¶
Alias for field number 4
- num_buffers¶
Alias for field number 8
- num_control_bus_channels¶
Alias for field number 5
- num_groups¶
Alias for field number 3
- num_input_bus_channels¶
Alias for field number 6
- num_output_bus_channels¶
Alias for field number 7
- num_synths¶
Alias for field number 2
- sample_rate¶
Alias for field number 0
- class FoxDot.lib.ServerManager.ServerManager(addr, port, osc_address='/s_new')[source]¶
Bases:
object
- class FoxDot.lib.ServerManager.TempoClient(clock)[source]¶
Bases:
object
- class FoxDot.lib.ServerManager.TempoServer(clock, port=57999)[source]¶
Bases:
ThreadedServerUsed in TempoClock.py to connect to instances of FoxDot over a network. Sends bpm changes over the network. On initial request this sends the start_time value of the clock
- class FoxDot.lib.ServerManager.ThreadedServer(server_address, RequestHandlerClass, bind_and_activate=True)[source]¶
Bases:
ThreadingMixIn,TCPServerBase class
- FoxDot.lib.ServerManager.send_to_socket(sock, data)[source]¶
Converts Python data structure to JSON message and sends to a connected socket
- FoxDot.lib.ServerManager.Server = FoxDot ServerManager Instance -> localhost:57110¶