View synthio_filter_test3.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# synthio_filter_test3.py -- dueling bandpass filters | |
# 7 Jun 2023 - @todbot / Tod Kurt | |
# video demo: https://www.youtube.com/watch?v=wIc6rovZ4aA | |
import time, board, audiopwmio, audiomixer, synthio | |
audio = audiopwmio.PWMAudioOut(board.GP10) | |
mixer = audiomixer.Mixer(channel_count=1, sample_rate=22050, buffer_size=2048) | |
synth = synthio.Synthesizer(sample_rate=22050) | |
audio.play(mixer) | |
mixer.voice[0].play(synth) |
View wavetable_synthio_synth.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# wavetable_synthio_synth.py -- Demonstrate new synthio.Synthesizer as wavetable MIDI synth | |
# 15 Apr 2023 - @todbot / Tod Kurt | |
# video demo: https://www.youtube.com/watch?v=uUnS3nR2K-8 | |
# | |
# Hooked up to generic I2S DAC | |
# Uses two pots: | |
# knobA - selects the base wave | |
# knobB - selects the mix between base wave and next wave | |
# |
View synthio_two_knob_drone_synth.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
View synthio_filter_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# synthio_filter_test.py -- trying out new filter PR, knobs control frequency and resonance | |
# 5 Jun 2023 - @todbot / Tod Kurt | |
import time, random, board, analogio, audiopwmio, synthio | |
audio = audiopwmio.PWMAudioOut(board.GP10) | |
synth = synthio.Synthesizer(sample_rate=22050) | |
audio.play(synth) | |
knob1 = analogio.AnalogIn(board.GP26) | |
knob2 = analogio.AnalogIn(board.GP27) |
View synthio_tiny_lfo_song.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# synthio_tiny_lfo_song.py -- tiny "song" made with just LFOs in synthio | |
# 29 May 2023 - @todbot / Tod Kurt | |
# video demo: https://www.youtube.com/watch?v=m_ALNCWXor0 | |
# requires CircuitPython 8.2.0-beta0 or later | |
import board, time, audiopwmio, synthio, random | |
audio = audiopwmio.PWMAudioOut(board.GP10) | |
synth = synthio.Synthesizer(sample_rate=22050) | |
audio.play(synth) | |
lfo_tremo1 = synthio.LFO(rate=3) # 3 Hz for fastest note |
View dual_i2s_player.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dual_i2s_player.py -- demonstrate using two I2S stereo DACs at once on RP2040 / Raspberry Pi Pico | |
# 19 May 2023 - @todbot / Tod Kurt | |
# video of this code: https://www.youtube.com/watch?v=CgqECxhqJEo | |
import time, board, audiocore, audiobusio | |
# qtpy rp2040 pins | |
# in this case, board.* names just match silkscreen, don't indicate functionality | |
lck1_pin, bck1_pin, dat1_pin = board.MISO, board.MOSI, board.SCK | |
lck2_pin, bck2_pin, dat2_pin = board.SCL, board.SDA, board.TX |
View udp_recv_code.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# udp_recv_code.py -- receive UDP messages from any receiver, can be another CircuitPython device | |
# 24 Aug 2022 - @todbot / Tod Kurt | |
# cribbing from code at https://github.com/adafruit/circuitpython/blob/main/tests/circuitpython-manual/socketpool/datagram/ntp.py | |
import time, wifi, socketpool | |
from secrets import secrets | |
print("Connecting to WiFi...") | |
wifi.radio.connect(ssid=secrets['ssid'],password=secrets['password']) | |
print("my IP addr:", wifi.radio.ipv4_address) | |
pool = socketpool.SocketPool(wifi.radio) |
View synthio_midi_synth.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# synthio_midi_synth.py - pretty usable MIDI-controlled synth using synthio in CircuitPython | |
# 11 May 2023 - @todbot / Tod Kurt | |
# Uses cheapie PCM5102 DAC on QTPY RP2040 | |
# Video demo: https://www.youtube.com/watch?v=N-PbbWWDE6k | |
# Features: | |
# - midi velocity controls attack rate (gentle press = slow, hard press = fast) | |
# - notes have small random detune on all oscillators to reduce phase stacking | |
# - adjustable number of detuned oscillators per note 1-5 (midi controller 83) | |
# - five selectable waveforms: saw, squ, sin, noisy sin, noise (midi controller 82) | |
# - vibrato depth on mod wheel (midi controller 1) |
View mqtt_demo_code.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mqtt_demo_code.py -- MQTT demo using public.cloud.shiftr.io | |
# 9 Oct 2021 - @todbot | |
# | |
# Uses LEDs on Adafruit Funhouse but adaptable to any CircuitPython WiFi board. | |
# | |
# To see what's going on, download MQTT-Explorer from http://mqtt-explorer.com/ | |
# Launch it and connect to the MQTT host/port/username/password as in secrets below. | |
# | |
# From MQTT-Explorer, you should see messages to "todbot/feeds/hello" every 3 seconds | |
# And then you can go to the right of MQTT-Explorer to Publish, fill in "todbot/feeds/light", |
View emoji_flipper.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# emoji_flipper.py - show a bunch of emojis from a sprite sheet | |
# 23 Jun 2022 - @todbot / Tod Kurt | |
import time | |
import board | |
import displayio | |
sprite_fname = "emoji_spritesheet_27x7_28x28.bmp" | |
sprite_cnt = 27*7 | |
sprite_w,sprite_h = 28,28 |
NewerOlder