forked from todbot/CircuitPython_Synthio_Tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_chorus.py
More file actions
29 lines (26 loc) · 833 Bytes
/
code_chorus.py
File metadata and controls
29 lines (26 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 6_effects/code_chorus.py
# part of todbot circuitpython synthio tutorial
# 14 Apr 2025 - @todbot / Tod Kurt
import time, random
import synthio
import audiodelays, audiofilters
from synth_setup import mixer, synth, SAMPLE_RATE, CHANNEL_COUNT, knobA
chorus1 = audiodelays.Chorus(
channel_count=CHANNEL_COUNT,
sample_rate=SAMPLE_RATE,
mix = 0.5,
voices = 3,
max_delay_ms = 50,
delay_ms = synthio.LFO(rate=0.5, offset=15, scale=5),
)
mixer.voice[0].play(chorus1) # plug effect into the mixer (unplugs synth)
chorus1.play(synth) # and plug synth into effect
while True:
midi_note = random.randint(36,64)
v = knobA.value/65535
chorus1.mix = v
print("playing %d mix: %.2f" % (midi_note,v))
synth.press(midi_note)
time.sleep(0.5)
synth.release(midi_note)
time.sleep(1)