Code + Community = CircuitPython is CircuitPython's tagline. And it took community to build the new audio effects in #CircuitPython. Here's Mark Komus touching on that in the latest episode of The CircuitPython Show:
Code + Community = CircuitPython is CircuitPython's tagline. And it took community to build the new audio effects in #CircuitPython. Here's Mark Komus touching on that in the latest episode of The CircuitPython Show:
Catch up on the latest episode of The CircuitPython Show and learn about the new audio effects in #CircuitPython. Here's Mark Komus on why the rp2350 is the right microcontroller for audio effects:
Got 3 mins? Like #electronics #maker #art #circuitpython #raspberrypi & other cool stuff? Here's a brief 3 min video of students in my "no prior experience" Physical Computing course. First of three projects they'll create in a semester. Their build guides & code linked in desc. youtu.be/u-Jj8-GV404
A #circuitpython asteroid tracker, although honestly not even in my top 10 existential threats right now
New episode of @circuitpythonshow is out today! Learn all about the new audio effects in #CircuitPython with guests @todbot, @stylus, Mark Komus, and Cooper Dalrymple. Find the show wherever you get your podcasts or visit https://www.circuitpythonshow.com/@circuitpythonshow/episodes/audio-effects-panel-discussion
Coming Monday on The CircuitPython Show: Hear about the new audio effects in #CircuitPython and @todbot's quest for a fatter synth sound:
Forbidden Planet “Krell” Display – MIDI CC Controller – Part 2
This revisits my Forbidden Planet “Krell” Display – MIDI CC Controller using my Forbidden Planet “Krell” Display PCB with a Waveshare RP2040 to create more of a “all in one” device.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to Arduino, see the Getting Started pages.
Parts list
PCB
This requires a built of the Forbidden Planet “Krell” Display PCB with the following:
I’ve used potentiometers that are their own knob, as they only poke through the casing by around 5mm or so.
If it you are able to get longer shaft pots, then that would probably be worthwhile.
Updated 3D Printed Case
This requires the following from the Krell Display 3D Printed Case:
This requires the following options in the OpenSCAD code:
show_frame = 1;
show_quadframe = 0;
show_insert = 1;
show_support = 0;
show_quadsupport = 0;
show_eurorack = 0;
show_eurorack_support = 1;
alg_pot1 = 1;
alg_pot2 = 1;
alg_cv = 0;
The frame does not really take into account the PCB at present, but I’ve reached the “good enough I want to do something else” stage, so I’ve just added a couple of small cut-outs (using a hacksaw) for the two MIDI sockets, and am content that the components stick out a bit from the back.
This cutout has to be 10.5mm from the end, 6mm wide, and 5mm deep.
At some point I might go back and design a deeper frame that has the cut-outs included and some kind of snap-on back to make it a self-contained box.
But for now, this is left as an exercise for, well, anyone else
Construction
I’ve used four brass 6mm spacers to screw into the mounting holes in the frame. Then the PCB can be inserted, taking care to squeeze in the 3D printed support around the LEDs and pots, and fixed with 20mm spacers which will also act as “legs”.
The Code
I’ve used a Waveshare Zero RP2040 and Circuitpython for this build. This is a combination of some of the test code used for the Forbidden Planet “Krell” Display PCB but with added MIDI.
The code supports both Serial and USB MIDI.
I wanted an equivalent of the Arduino map() and constrain() functions and didn’t immediate spot them in Circuitpython so wrote my own:
def algmap(val, minin, maxin, minout, maxout):
if (val < minin):
val = minin
if (val > maxin):
val = maxin
return minout + (((val - minin) * (maxout - minout)) / (maxin - minin))
This allows me to map the analog read values (0 to 65535) down to MIDI CC values (0 to 127) whilst also allowing for some inaccuracies (I’ve treated anything below 256 as zero for example):
alg1cc = int(algmap(alg1_in.value,256,65530,0,127))
I’ve used the Adafruit MIDI library, which I’m still not really a fan of, but I wanted to include MIDI THRU functionality to allow the controller to sit inline with an existing MIDI stream. But it doesn’t seem to work very well.
I was already only updating the LEDs/MIDI CC if the pot values had changed, to cut down on the number of Neopixel writes required.
I experimented with changing the scheduling of the analog reads and MIDI but that didn’t seem to help very much. In the end I made sure that all MIDI messages queued up in the system would be read at the same time before going back to checking the pots.
msg = midiuart.receive()
while (msg is not None):
if (not isinstance(msg, MIDIUnknownEvent)):
midiuart.send(msg)
msg = midiuart.receive()
It will do for now. Moving forward, I might try the Winterbloom SmolMIDI library. If that still doesn’t give me some useful performance then I might have to switch over to Arduino C.
Closing Thoughts
The MIDI throughput is disappointing, but then I’ve never really gotten on with the Adafruit MIDI library. I use it as USB MIDI on Circuitpython is so easy, so will need to do something about that.
I’m still deciding on the PCB-sized supports too. The original seemed to have nicer diffusion of the LEDs, but that could have been the difference between 5mm SMT neopixels and these THT APA106s which seem more directional in the first place.
And I really ought to finish the 3D printed case properly too.
So this is “that will do” for now, but I ought to come back and finish it off properly at some point.
Kevin
Coming Monday on the next episode of The CircuitPython Show: A panel discussion with @todbot, core developer @stylus, Mark Komus, and Cooper Dalrymple all about the new audio effects in #CircuitPython. Here's Cooper on what the effects are based on:
Do you or your business have a #YouTube channel? Want to create your own colorful LED display sign with scrolling address & subscriber / views stats? Change just one config file & this #CircuitPython project is ready to go! Learn how here: https://youtu.be/OV67IjXsQbA?si=atS-sDFxkyc3VSUd
#CircuitPython controlled pocket operator. KB2040 is setup as a midi in device. Reason is sending out four midi tracks on four different midi channels. Each button/synth voice on the pocket operator is assigned a midi channel. When a note on message comes in on the corresponding channel, the button is triggered via GPIO through a mosfet. The DAC is controlling the pot that is used for notes for some of the synth voices #pocketoperator
And just like that we have a functioning clock! currently running on a propmaker RP2040 but I will probably have to move over to something WiFi enabled before long #pcb #electronics #maker #RP2040 #RaspberryPi #jlcpcb #circuitpython @adafruit
@rpimag I did a bit more work on my UART booting Flashless Picos. On the end of each "pico" there's an I2C port for the I/O expander (used to reset/setup the RP2350A to boot from UART) and a UART port to send the bin file/communicate after boot. The Pico2 in the PicoUART6 is running CircuitPython using Adafruit_CircuitPython_PIO_UART for the non-hardware UARTs.
Couldn’t get button 6 to work consistently but otherwise 15/16 synth sounds are controllable from the KB2040. Quick test sketch in #circuitpython toggling the GPIO and cat LED (slow cycle RGB led)
Work in progress of a Reverb sound effect for CircuitPython. Based on FreeVerb. #CircuitPython #Reverb
Love getting the Instructables email from AutoDesk and seeing a student’s #CircuitPython project highlighted. Nice work on Tilt-a-Sketch, Alfonso DeVito ! https://www.instructables.com/Tilt-a-Sketch/
#CircuitPython 9.2.6 released!
https://blog.adafruit.com/2025/03/22/circuitpython-9-2-6-released/
Highlights of this release
- Fix `storage.remount("/", readonly=False)` regression.
- Fix RP2xxx WiFi mDNS limitations.
NeoPixel LEDs are cool. Making them twirl up & down a light strip by using a potentiometer? Even cooler. And doing it with python slices using a @RaspberryPi Pico? Super fun! Dig in to the latest lesson of #CircuitPython School. #CSEd friends, STEM goodness for your class https://youtu.be/1-sgErNV-b0?si=jeHuiRYTzMKbF4Q9
#CircuitPython 9.2.5 released!
Highlights of this release:
- Update frozen modules.
- Enable function attributes and reverse arithmetic operators on most boards.
- displayio:
- Add tilepalettemapper.
- Add VT100 escape code support for scrolling and colors.
- synthio and audiodelays additions.
- Add audioio on Espressif.
- Add spitarget on SAMx (enabled on most SAMx5x boards).
- Initial work on a Zephyr port.
- Bug fixes.
https://blog.adafruit.com/2025/03/18/circuitpython-9-2-5-released/
Would-be DJs, #Makers, and #STEMEd friends, learn how to mix-sounds & on a low-cost touch-reactive board! This super-fun #CircuitPython lesson is one my students love. @RaspberryPi Pico & @Adafruit CircuitPlayground Bluefruit code/wiring shown. 32-bit Word to your Mother. youtu.be/RkrbChO-jGk