API Reference

relic_synthiota

Helper library for Synthiota

  • Author(s): Cooper Dalrymple

Implementation Notes

Hardware:

Software and Dependencies:

class relic_synthiota.Slider(pads: list, wrap: bool = False, offset: int = 0, scale: int = None, pull: digitalio.Pull | None = None)

Simple capacitive touch slider made from three pads attached to an MPR121.

Create a Slider object using the provided MPR121 channels.

Parameters:
  • pads – A list of 3 adafruit_mpr121.MPR121_Channel objects

  • wrap – Whether or not to wrap the value in a “circular” fashion

  • offset – An offset that will be applied to the slider value from 0 to 1

  • scale – The size of each pad, defaults to 0.333.

  • pull – Specify external pull resistor type. If None, assume pull-down or chip-specific implementation that does not require a pull.

property raw_value: Tuple[float]

Get the relative position value of each slider pad.

reset() None

Reset the baseline data of the MPR121.

property value: float

Get the position of the slider as a number from 0 to 1 or returns None if there is no touch detected.

class relic_synthiota.Synthiota(voice_count: int = 1, sample_rate: int = _DEFAULT_SAMPLE_RATE, channel_count: int = _DEFAULT_CHANNEL_COUNT, buffer_size: int = _DEFAULT_BUFFER_SIZE)

Helper library for Synthiota.

Setup hardware resources including audio output, midi usb/uart, touch inputs, display, neopixels, encoder, and potentiometers.

Parameters:
  • voice_count – The maximum number of voices to mix

  • sample_rate (int) – The sample rate to be used for all samples

  • channel_count (int) – The number of channels the source samples contain. 1 = mono; 2 = stereo.

  • buffer_size (int) – The total size in bytes of the buffers to mix into

property audio: audiobusio.I2SOut

The I2S audio output object.

property buffer_size: int

The total size in bytes of the buffers used by the mixer

property channel_count: int

The number of channels of the audio output. 1 = mono; 2 = stereo.

property display: SH1106

The display bus object.

property down_button: adafruit_debouncer.Button

The object for the down button.

property down_led: adafruit_pixelbuf.PixelReturnType | None

The NeoPixel above the down button.

property edit_led: adafruit_pixelbuf.PixelReturnType | None

The edit NeoPixel.

property encoder: rotaryio.IncrementalEncoder

The incremental encoder object.

property encoder_button: adafruit_debouncer.Button

The object for the encoder button.

get_midi_messages() Tuple[Message | None]

Read all available messages from both the USB and UART MIDI ports.

property leds: neopixel.NeoPixel

The neopixel driver which controls all 27 leds on the device.

property left_slider: Slider

The object for the left horizontal touch slider.

property left_slider_leds: adafruit_pixelbuf.PixelReturnSequence | None

The NeoPixels above the left slider from left to right.

property mixer: audiomixer.Mixer

The audio output mixer. Use this object to attach your audio sources.

property mode_led: adafruit_pixelbuf.PixelReturnType | None

The mode NeoPixel.

property mode_leds: adafruit_pixelbuf.PixelReturnSequence | None

The mode NeoPixels in the order of edit, mode, and play.

property play_led: adafruit_pixelbuf.PixelReturnType | None

The play NeoPixel.

property pot_leds: adafruit_pixelbuf.PixelReturnSequence | None

The NeoPixels corresponding to each of the 8 potentiometer from left-to-right.

property pots: Tuple[float | None]

All 8 potentiometer values as a tuple of floats from 0 to 1.

property right_slider: Slider

The object for the right horizontal touch slider.

property right_slider_leds: adafruit_pixelbuf.PixelReturnSequence | None

The NeoPixels above the right slider from left to right.

property sample_rate: int

How quickly samples are played through the audio output in Hertz (cycles per second)

send_midi_message(message: Message) None

Send a message to both the USB and UART MIDI ports.

Parameters:

message – The MIDI message you would like to send.

property step_leds: adafruit_pixelbuf.PixelReturnSequence | None

The NeoPixels for each step touch pad in left-to-right order from bottom-left to top-right.

property touched: Tuple[bool | None]

The state of all touchpads as a tuple of 24 booleans.

property touched_steps: Tuple[bool | None]

The state of all 16 step touch pads in left-to-right order from bottom-left to top-right.

property up_button: adafruit_debouncer.Button

The object for the up button.

property up_led: adafruit_pixelbuf.PixelReturnType | None

The NeoPixel above the up button.

update() None

Update buttons, potentiometers, and touch inputs. Call this frequently for the best results!

property voice_count: int

The maximum number of voices available in the mixer