As Elk is a complete platform on which you can build powerful audio processing devices quickly, it wouldn’t be complete without a way of connecting physical controls, such as buttons, knobs or interactive sensors, i.e pressure, distance or other types of sensors to the device. Usually these sensors are connected to ADCs and/or digital I/O pins, and their use requires a fair amount of low level programming in order to interface with and convert their raw output into a format usable for controlling audio plugins, be it MIDI, OSC, or other.
Sensei is the controller software in the Elk Audio OS, that enables you to easily connect physical controls to an Elk board, and use them to control the audio host Sushi, along with all the plugins it is hosting. Sensei supports a variety of controllers such as buttons, rotary encoders, LEDs, ribbon controllers and anything else that outputs an analog voltage like potentiometers, pressure sensors, etc. In addition, Sensei supports routing and basic clipping and scaling of values.
Controllers and sensors are defined declaratively in a json file, where the user specifies a list of hardware controllers, their types, which i/o pin(s) they are connected to, along with further parameters such as update rate, filtering and also clipping and scaling of the output range. Then Sensei handles the rest and allows you to output messages through one of its backends.
Sensei is of a modular design, and currently has 2 output backends: a terminal output that is mainly for debugging, and an OSC backend that can be used to control Sushi directly, or through a middleware “glue application”. More output backends can be added in the future.
On some Elk boards the I/O pins are managed by a microcontroller, in which case Sensei interfaces with them through a custom driver. On other boards, the pins are handled by the main CPU. In both cases Sensei abstracts away all the low-level details of interacting with GPIO pins into a simple interface so the developer doesn’t have to worry about them. It also ensures that config files are portable across different Elk boards.
A Sensei configuration file defines a list of sensors connected to the board and which pin(s) they are connected to. Each sensor is configured through a sensor type which defines its behaviour, and a hardware type which specifies what type of physical controller it represents.
Support for more hardware types will be added in the future. If you need to connect a sensor or output device for which there is no native support, or for which there is no physical hardware type ready, you will have the possibility to do so by rebuilding Sensei with the open-source version of Elk.
The example below shows a Sensei setup with a potentiometer connected to an analog input pin and an LED connected to a digital output pin that can be turned on and off from an application interacting with Sensei.
"backends" : [
"id" : 0,
"type" : "osc",
"host" : "localhost",
"port" : 23023,
"base_path" : "/sensors",
"base_raw_input_path" : "/raw_input"
"sensors" : [
"id" : 1,
"name" : "LED 1",
"sensor_type" : "digital_output_pin",
"hardware_type" : "digital_output_pin",
"pins" : 
"id" : 23,
"name" : "Knob 1",
"sensor_type" : "analog_input",
"mode" : "on_value_changed",
"hardware_type" : "analog_input_pin",
"pins" : ,
"delta_ticks" : 1,
"adc_resolution" : 8,
"filter_time_constant" : 0.01
Sensei can be used to directly control Sushi over OSC, but the most common use case is to have an intermediary Main app or “glue program” between Sushi and Sensei, that maps to parameters and encapsulates some simple logic. For instance, many devices have multi-function controls that can control different parameters depending on the current settings. In most cases such logic would be best implemented in the glue program