Skip to content

Instantly share code, notes, and snippets.

@todbot
Last active June 28, 2023 02:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todbot/53bfa7333ac7c1fcff8eaf0f547556ff to your computer and use it in GitHub Desktop.
Save todbot/53bfa7333ac7c1fcff8eaf0f547556ff to your computer and use it in GitHub Desktop.
Got a Pico and two pots? Now you got a drone synth. In CircuitPython of course
# synthio_two_knob_drone_synth.py -- Got a Pico and two pots? Now you got a drone synth
# 5 Jun 2023 - @todbot / Tod Kurt
# video demo: https://www.youtube.com/watch?v=KsSRaKjhmHg
import time, random, board, analogio, audiopwmio, synthio
knob1 = analogio.AnalogIn(board.GP26)
knob2 = analogio.AnalogIn(board.GP27)
audio = audiopwmio.PWMAudioOut(board.GP10)
synth = synthio.Synthesizer(sample_rate=22050)
audio.play(synth)
note1 = synthio.Note(frequency=100)
note2 = synthio.Note(frequency=200)
synth.press((note1,note2))
while True:
note1.frequency = synthio.midi_to_hz( knob1.value / 512 )
note2.frequency = synthio.midi_to_hz( knob2.value / 512 )
@todbot
Copy link
Author

todbot commented Jun 6, 2023

video demo:

synthio_two_voice_drone_synth.mp4

@RobCranfill
Copy link

Can you share the design - such as it is :-) - of that low-pass filter? Looks so much simpler than the RP2040 reference design. I can't quite make out the cap and resistor's values in the video.

@todbot
Copy link
Author

todbot commented Jun 28, 2023

Sure!, It's 100n & 1k. It's super janky as it doesn't remove the DC offset (but most all line ins have that too so it's usually not a problem)

But also, I'm slowly coalescing all these gists into a single repo, with wiring diagrams: https://github.com/todbot/circuitpython-synthio-tricks/tree/main/examples

@RobCranfill
Copy link

RobCranfill commented Jun 28, 2023

Thank you! I kinda remembered seeing that somewhere in your stuff, so my apologies for not remembering where that was. But then I’ve gotten so much good info from your various projects… :-]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment