elkpy.TransportControlller

class elkpy.transportcontroller.TransportController(address='localhost:51051', sushi_proto_def='/usr/share/sushi/sushi_rpc.proto')[source]

Bases: object

A class to control the transport in sushi via gRPC. It controls transport related information in sushi like samplerate, playback mode, sync mode, time signature and tempo.

Attributes:
_stub (TransportControllerStub): Connection stubs to the gRPC transport interface implemented in sushi.
__init__(address='localhost:51051', sushi_proto_def='/usr/share/sushi/sushi_rpc.proto')[source]

The constructor for the TransportController class setting up the gRPC connection with sushi.

Parameters:
address (str): ‘ip-addres:port’ The ip-addres and port at which to connect to sushi. sushi_proto_def (str): path to .proto file with SUSHI’s gRPC services definition
get_playing_mode() → int[source]

Get the current playing mode.

Returns:
int: Current playing mode.
1 = Stopped, 2 = Playing, 3 = Recording (not implemented)
get_samplerate() → float[source]

Get the current samplerate.

Returns:
float: Current samplerate.
get_sync_mode() → elkpy.sushi_info_types.SyncMode[source]

Get the current sync mode.

Returns:
int: Current sync mode.
1 = Internal, 2 = MIDI, 3 = Link
get_tempo() → float[source]

Get the current tempo.

Returns:
float: Current tempo in BPM(Beats Per Minute).
get_time_signature() -> (<class 'int'>, <class 'int'>)[source]

Get the current time signature.

Returns:
int: The nominator of the time signature. int: The denominator of the time signature.
set_playing_mode(playing_mode: elkpy.sushi_info_types.PlayingMode) → None[source]

Set the playing mode.

Parameters:
playing_mode (PlayingMode): The playing mode to set.
1 = Stopped, 2 = Playing, 3 = Recording (not implemented)
set_sync_mode(sync_mode: elkpy.sushi_info_types.SyncMode) → None[source]

Set the sync mode.

Parameters:
sync_mode (SyncMode): The sync mode to set.
1 = Internal, 2 = MIDI, 3 = Link
set_tempo(tempo: float) → None[source]

Set the tempo.

Parameters:
tempo (float): The tempo in BPM(Beats Per Minute).
set_time_signature(numerator: int, denominator: int) → None[source]

Set the time signature

Parameters:
numerator (int): The numerator of the time signature. denominator (int): The denominator of the time signature. Should be either 4 or 8.