Simple test
Ensure your device works with this simple test.
examples/synthiota_simpletest.py
1# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2# SPDX-FileCopyrightText: Copyright (c) 2026 Cooper Dalrymple
3#
4# SPDX-License-Identifier: Unlicense
5import random
6import time
7
8import displayio
9import synthio
10import tmidi
11import vectorio
12
13import relic_synthiota
14
15displayio.release_displays()
16synthiota = relic_synthiota.Synthiota()
17
18# display
19root_group = displayio.Group()
20synthiota.display.root_group = root_group
21
22palette = displayio.Palette(1)
23palette[0] = 0xFFFFFF
24root_group.append(
25 vectorio.Circle(
26 pixel_shader=palette,
27 radius=synthiota.display.height // 2,
28 x=synthiota.display.width // 2,
29 y=synthiota.display.height // 2,
30 )
31)
32
33# audio
34synth = synthio.Synthesizer(sample_rate=synthiota.sample_rate)
35synth.envelope = synthio.Envelope(attack_time=0.05, attack_level=0.8, release_time=0.6)
36synthiota.mixer.voice[0].play(synth)
37synthiota.mixer.voice[0].level = 0.25 # 0.25 usually better for headphones, 1.0 for line-in
38
39notenum = None
40note_counter = 0
41last_timestamp = time.monotonic()
42while True:
43 synthiota.update()
44
45 # synth
46 current_timestamp = time.monotonic()
47 delta = current_timestamp - last_timestamp
48 last_timestamp = current_timestamp
49 if (note_counter := note_counter - delta) <= 0:
50 if notenum is None:
51 notenum = random.randint(32, 60)
52 synth.press(notenum)
53 synthiota.send_midi_message(tmidi.Message(tmidi.NOTE_ON, data0=notenum, data1=127))
54 note_counter = 0.3
55 else:
56 synth.release(notenum)
57 synthiota.send_midi_message(tmidi.Message(tmidi.NOTE_OFF, data0=notenum))
58 notenum = None
59 note_counter = 0.5
60
61 # controls
62 print("Encoder Position:", synthiota.encoder.position)
63 print("Encoder Switch:", synthiota.encoder_button.pressed)
64 print("Up:", synthiota.up_button.pressed)
65 print("Down:", synthiota.down_button.pressed)
66 print("Left Slider:", synthiota.left_slider.value)
67 print("Right Slider:", synthiota.right_slider.value)
68 print("Steps:", "".join([str(int(x)) for x in synthiota.touched_steps]))
69 print("Pots:", synthiota.pots)
70 print()
71 time.sleep(0.05)
LEDs
Iterate through all of the LEDS available on the Synthiota in order.
examples/synthiota_leds.py
1# SPDX-FileCopyrightText: Copyright (c) 2026 Cooper Dalrymple
2#
3# SPDX-License-Identifier: Unlicense
4import time
5
6import relic_synthiota
7
8DELAY = 0.1
9COLOR = 0xFF00FF
10
11synthiota = relic_synthiota.Synthiota()
12
13while True:
14 for i in range(16):
15 synthiota.step_leds = [COLOR if i == j else 0x000000 for j in range(16)]
16 time.sleep(DELAY)
17 synthiota.step_leds = 0x000000
18
19 for i in range(8):
20 synthiota.pot_leds = [COLOR if i == j else 0x000000 for j in range(8)]
21 time.sleep(DELAY)
22 synthiota.pot_leds = 0x000000
23
24 for i in range(3):
25 synthiota.left_slider_leds = [COLOR if i == j else 0x000000 for j in range(3)]
26 time.sleep(DELAY)
27 synthiota.left_slider_leds = 0x000000
28
29 synthiota.up_led = COLOR
30 time.sleep(DELAY)
31 synthiota.up_led = 0x000000
32
33 synthiota.down_led = COLOR
34 time.sleep(DELAY)
35 synthiota.down_led = 0x000000
36
37 for i in range(3):
38 synthiota.right_slider_leds = [COLOR if i == j else 0x000000 for j in range(3)]
39 time.sleep(DELAY)
40 synthiota.right_slider_leds = 0x000000
41
42 for i in range(3):
43 synthiota.mode_leds = [COLOR if i == j else 0x000000 for j in range(3)]
44 time.sleep(DELAY)
45 synthiota.mode_leds = 0x000000
46
47 synthiota.edit_led = COLOR
48 time.sleep(DELAY)
49 synthiota.edit_led = 0x000000
50
51 synthiota.mode_led = COLOR
52 time.sleep(DELAY)
53 synthiota.mode_led = 0x000000
54
55 synthiota.play_led = COLOR
56 time.sleep(DELAY)
57 synthiota.play_led = 0x000000