elkpy.KeyboadController#

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

Bases: object

A class to control the keyboard in sushi via gRPC. It can send typical keyboard events like note on, note off, pitch bend, modulation and after touch.

Attributes:

_stub (KeyboardControllerStub): Connection stubs to the gRPC keyboard interface implemented in sushi.

send_aftertouch(track_identifier: int, channel: int, value: float) None[source]#

Sends a aftertouch message to the specified track.

Parameters:

track_identifier (int): The id of the track that should receive the message. channel (int): The channel on which the message should be sent. value (float): The aftertouch value. Should be in range (0.0-1.0).

send_modulation(track_identifier: int, channel: int, value: float) None[source]#

Sends a modulation message to the specified track.

Parameters:

track_identifier (int): The id of the track that should receive the message. channel (int): The channel on which the message should be sent. value (float): The modulation value. Should be in range (0.0-1.0).

send_note_aftertouch(track_identifier: int, channel: int, note: int, value: float) None[source]#

Sends a aftertouch message to the specified track and note.

Parameters:

track_identifier (int): The id of the track that should receive the message. channel (int): The channel on which the message should be sent. note (int): The note which should receive the message. Follows the MIDI standard where middle c = 60. value (float): The aftertouch value of the note. Should be in range (0.0-1.0).

send_note_off(track_identifier: int, channel: int, note: int, velocity: float) None[source]#

Sends a note off message to the specified track.

Parameters:

track_identifier (int): The id of the track that should receive the message. channel (int): The channel on which the message should be sent. note (int): The note to send. Follows the MIDI standard where middle c = 60. velocity (float): The velocity of the note. Should be in range (0.0-1.0).

send_note_on(track_identifier: int, channel: int, note: int, velocity: float) None[source]#

Sends a note on message to the specified track.

Parameters:

track_identifier (int): The id of the track that should receive the message. channel (int): The channel on which the message should be sent. note (int): The note to send. Follows the MIDI standard where middle c = 60. velocity (float): The velocity of the note. Should be in range (0.0-1.0).

send_pitch_bend(track_identifier: int, channel: int, value: float) None[source]#

Sends a pitch bend message to the specified track.

Parameters:

track_identifier (int): The id of the track that should receive the message. channel (int): The channel on which the message should be sent. value (float): The pitch bend value. Should be in range (0.0-1.0).