
·S3 E22
The rant and the love letter
Episode Transcript
Welcome to The Bootloader, I'm Tod Kurt.
And I'm Paul Cutler.
The show works like this.
Tod and I have each brought three things to share, which we'll chat about for a few minutes, but no more than about five.
For detailed show notes, links and transcripts, visit thebootloader.net.
Tod, what's your first one for us?
All right, so you know my continuing quest to make microcontrollers act like synthesizers.
Well, what if there was a single chip you could add to your circuit that you could talk to with a single serial wire that not only gave you a synth voice, but a 64 voice synth with 128 different sounds, including piano, strings, bass guitar, a full drum kit, and they can all play simultaneously, it's multi-timbral.
And it can play different sounds on different MIDI channels and you can change the sounds with MIDI program change messages.
Oh, and it also has audio effects to apply to those sounds like EQ, reverb, and chorus.
and it has a mic input that you can treat with those effects.
This thing is bonkers.
It's called the SAM2695, and it's a full General MIDI synthesizer on a chip.
You may remember General MIDI or GM from PC video games in the '90s, where if you had a special Sound Blaster or an outboard GM MIDI module, your games would have much more cinematic music than normal.
I remember playing "Star Wars TIE Fighter" on a friend's computer that had one of these, and man, it felt like I was in the movie.
The SAM2695 chip is from a French company called Dream.
They seem to specialize in these one-chip solutions to many music hobbyist needs, like keyboard synthesizer chip, USB audio interface chip, and 81 voice piano chip.
Their SAM2695 is an earlier effort aimed at really low cost applications.
It's around $4 in quantity, it seems like, when I'm looking around on Alibaba and stuff, and requires just a handful of support components, like just an oscillator and a couple of capacitors and resistors.
It can be completely controlled by a single logic level MIDI input serial line, making it really easy to embed.
And in fact, you can get some pre-made modules that use this chip right now from Seed or M5Stack.
The Seed one is called the Xiao MIDI, the M5Stack one's called the MIDI Synth with Speaker, and they make another one called the MIDI Unit with MIDI In/Out.
And if you'd like to learn more about this chip and one of the M5Stack boards, Kevin from DIY Electro Music has a great series of articles using this, the M5 stack version, with a cutie pie Xiao board.
Kind of just to show you how little you need in terms of CPU to actually control one of these.
On Dream's website, the 2695 is marked as "not recommended for new designs," but it seems like that's not stopping the above companies.
I wonder what will happen to the above products if this chip really goes away.
I don't think they're working off a copy of the chip, because it's a pretty complex thing.
I hope this chip continues to be made forever, because it's so cool.
I've got the M5 stack versions.
I've been playing around with them for a couple of days.
They're super cheap.
They're about 12 bucks for the one with a built in speaker and $14 for the one that has the actual MIDI ports and an audio output jack.
And there'll be links to all this stuff in the show notes.
Yeah, I was surprised how cheap they were.
I mean, you're talking 12 to 20 bucks for the two or three ones that you link to it.
Yeah, yeah.
For like a fully built thing with a little little cable, you can just plug into your under your breadboard or into your circuit.
And so what the heck, man?
It's all this struggle that I've been putting on for the last several years of making synthesizers running in the microcontroller, we could just like farm it out to a little, you know, side chip.
You have to have a whole new tips and tricks page just for that chip.
Yeah.
Well, the thing is, like, General MIDI has been around since the like late 80s, early 90s.
So there's a lot of precomposed music that just runs on that assumes that the general MIDI sound set.
And so one of the initial things might be to just have a simple MIDI player that reads MIDI files off an SD card and just sends the MIDI messages out to this chip and see what it sounds like.
I bet it would sound pretty cool.
I bet it would.
(Tod laughs) All right, so what's your first one this time?
My first one feels like I'm trespassing in your territory, Tod.
(Tod laughs) I just learned about SuperCollider, which is a synth engine that's been around since 1996.
So I'm guessing you've heard of it.
Oh, yes.
SuperCollider has three components, SC-Synth, a real-time audio engine implemented as a server, SClang, an interpreted program language that acts as a client to the server that is similar to Smalltalk, and SCIDE, an editor for SClang with an integrated help system.
The server and client communicate using Open Sound Control, or OSC.
I looked at some of the SuperCollider code examples, but couldn't wrap my head around it at all.
The reason I'm bringing up a synth engine that's been around for 30 years now is because earlier this year, Andrew Clark thankfully wrote a Python API to SuperCollider he calls I hope I pronounced that right.
And then he wrote a dozen examples and published them on GitHub.
They include an arpeggiator, an LFO, drum sequencers, and more.
Then he takes it to the next level.
He created a subreddit where he explains each demo, including an introduction to the concept, code for each demo, and then a walkthrough.
Knowing a little bit of Python, I was able to almost wrap my head around the concepts.
And if Python isn't your thing, there's also APIs for JavaScript, Haskell, and more.
That's really interesting.
Because SuperCollider has been around for so long and because it's a programming oriented thing, I've been aware of it and I've bounced off of it like a half a dozen times trying to write stuff in it.
And I just never been able to because it feels like a research project that turned into an open source community from like 40 years ago or something.
So it's kind of just got a different shape than what I'm used to.
But the Python interface looks pretty reasonable, you know?
So hey, lots of really cool sounds have been made with SuperCollider.
What's your next one for us?
All right.
I'm going to rant about STM32 development tools.
Now realize, I'm a make file and text editor guy.
My debugger is print statements, pin toggles, and oscilloscopes.
I've developed for just about every low-cost microcontroller except the STM32.
Now for work reasons, I'm about to get into the STM32.
I started the dive thinking it'd be similar to the other ARM-based CPUs that I've worked with.
I quickly find that it seems the majority of people are using ST's collection of IDE tools.
Oh no, vendor required IDEs.
You know what's worse than trying to reuse Arduino to write microcontroller code?
Trying to use Eclipse to write code.
What's worse than that?
Using a vendor's wrapped version of Eclipse.
And worse than that?
A vendor-skinned Eclipse that sub-apps that run in entirely different Java VMs to configure the chip with a GUI.
Worse than that, the only build for these tools is for Mac OS is Intel, so it runs an x86 Rosetta emulation.
Thus a keystroke you type goes from native code to emulated x86 to Java VM to Eclipse GUI to vendor wrapper and finally to your screen.
To say it slow is to be kind.
On top of all that, it seems like everyone in the STM world relies on this dang GUI to configure the chips.
So I kind of blame Arduino for this situation Before Arduino programming microcontrollers was like this.
It was a real pain It was Windows only using proprietary IDEs written in Visual Basic invoking proprietary compilers all of this costing thousands of dollars Just getting to a blinking LED would take you weeks But around in 1989 AVR GCC and AVR libc was created by some kind hackers a fully open source Compiler suite for the very nice at Mel AVR microcontroller chips Of course, Atmel wanted nothing to do with this, but everyone loved it.
And when graduate student Hernando Bargan created his wiring thesis project in 2003 by smashing AVRGCC together with a hacked version of the Processing IDE, the beginning of what we now know as Arduino was created, a fully open-source, cross-platform IDE for writing and debugging microcontroller projects.
I've used the Arduino IDE as a starting point for many projects, and moving to a command-line make file with AVRGC was pretty painless, letting me use any more advanced code editor.
Because Arduino cores are open source, if you want to know how Arduino is configuring the chip or setting up pins, just poke around the core and find out how this chip's digital write works.
So people bag on the Arduino IDE now, but it was revolutionary.
It set a new standard baseline for MCU development apps based on GCC, Windows Mac Linux builds, and the core compiler tools and libraries open source.
And it doesn't try to lock you into the IDE.
So now, after Arduino came around, microcontroller vendors wanted more features than the Arduino IDE could manage.
So what do you do?
At the time, the Eclipse IDE was the VS Code of the day, a highly extensible IDE that could take plugins and be reskinned.
Unlike VS Code, Eclipse was slow, bloated, terrible to look at, at least to me.
And the MC inventors didn't help this with their often sloppy wrapping of Eclipse in their own toolkits to help the user.
It further obfuscated what I was trying to do.
Just give me a well-organized makefile, a standard library with docs and some example projects.
I don't need your fancy GUIs.
If you've ever done ESP32 or Raspberry Pi C development, you've experienced the benefits that I think that Arduino started.
Good open standard libraries, good docs, GCC compiler, all of it immensely scriptable via Makefiles or CMake, and all very open source.
All you need to write code for these chips is a text editor and a terminal window.
And then STM32, the only MCU platform I've delved into.
Their chips are great, I've been envious of my compatriots who have facility with them, but the tooling, it's like stepping back into the early 2000s with the weirdly slow proprietary IDEs, especially on the Mac currently.
Thankfully, under the hood, it's all standard ARM GCC with a decent set of libraries for these chips.
But I can only find the API docs for these libraries in their crazy IDE.
There's no website for them, as far as I can tell, no PDFs.
That's maddening.
One sub app of the IDE is called STMQBMX, and it's a code generator to do proper chip configuration startup.
This is useful, especially the way some of the STM chips work.
And it only takes about 15 seconds to start, which I don't know, maybe I'm maybe I'm just just selfish here, but I think an app should start in faster than 15 seconds.
And it seemingly has example projects that can generate for your chip.
But I've not been able to find a way to actually get them to actually work.
And when you're searching for them, good luck, because every time you type a character into the search field, It causes the whole GUI to pause for several seconds as it sort of relays it out to sort of show you the updated search results.
*sigh* So, but it's very powerful and it generates code that does work.
It blessedly can generate Makefile-compatible projects, but these code generators are fairly one-way.
If you edit any of the output and then you go back to the code generator and change, make some settings, you might be stuck.
You might get your code overwritten.
I can already see the need to make some chip configuration changes.
And it seems like the fastest path for me might be to start a whole new project, make those changes, then copy over my code from the previous project to it.
In theory there are regions in the code files that are safe from the code generator, but not everything that needs to be modified are in those regions.
So that's my rant.
I'm loving the STM32 chips.
I've already got first light on a project using them, and I'm learning them enough that I can almost wean myself off the weird GUIs, but man, it's slow going.
Well, it's 2025.
Who doesn't have their documentation online?
There's whole frameworks for documentation like Astro and JavaScript or MKDocs and Python to make it easy to write docs.
Yeah, I mean, I mean, part of it, part of it is is STM, STM Microelectronics, I think, is very sort of typical for most vendors.
I think Espressif and Raspberry Pi are sort of aberrant and they're so good at their documentation.
And so I think I just need to be in the culture, be in the community a bit more and learn where things are.
I'm I've not found it's like surely there must be API doc somewhere It's not just reading the source But you know who knows?
Well next up I have the perfect antidote to your rant And that's a lecture in video titled a love letter to embedded systems by V Hunter Adams Professor Adams teaches what I think is a graduate level course at Cornell University called digital systems design using microcontrollers It looks like the course uses Raspberry Pi Picos using the Pico SDK in C and teaches embedded development with projects like synthesizing birdsong or controlling a 1D helicopter.
This lecture is from a little later in the semester and Professor Adams warns that it's the first time he's given this particular lecture.
In it, he tries to answer four questions.
Why should you do engineering projects?
What makes embedded projects special?
And two questions for his students.
are some projects other students have completed and how can you get started on projects on your own?
Coming back to that first question, why should you do an engineering project?
He goes on to share that it's important to build things because it's really hard.
Nothing ever works.
He talks a little bit about simulations versus real world building.
And then he has one of my two favorite quotes from the lecture.
Building things fills you with humility and wonder.
You will weep in awe of things like keyboards.
And you know what?
He's right.
been a maker for a handful of years and the things I've learned on how things are built does leave me with wonder and the keyboard example is perfect.
Something we use every day but you try to wire the rows and columns and make a working keyboard with the bouncer and everything that goes into it.
Second he goes on to ask what makes embedded projects so special.
He goes off on a little bit of a tangent on Leonardo da Vinci.
His point being that da Vinci would spend months or years researching something like anatomy or shadows before putting it into practice by painting something like the Mona Lisa.
His point being is that engineering is the mechanism for learning other stuff.
But why embedded?
They offer constraints and constraints beget complexity.
Microcontrollers are just the right amount of complexity.
For example, a data sheet can be hundreds of pages, which is complex, but not beyond the capacity of one person.
And if you get a little magic smoke, microcontrollers just a few bucks and maybe some burn fingertips, make a mistake with a high power system, and...
And then lastly, he shares my favorite quote, which is something I've struggled to articulate when I'm asked about my hobbies and why I enjoy them.
Professor Adams shares that one reason he believes embedded engineering is special is because it sits on the boundary of the natural world and the computational world.
Debugging places you in conversation with nature and with physics.
Is the bug in the software, the hardware, or is it a consequence of physics?
The lecture is about 40 minutes and I'm not saying you should rush out and watch it right away.
But if you're doing something else like cooking in the kitchen, doing the dishes or out for a walk, give it a listen.
I think you'll enjoy it.
Yeah, it's so good.
I've actually been watching this lecture of his.
I'm about like maybe 10 lectures in or so.
I haven't gotten to this one yet, but I listened to this whole thing.
It's wonderful.
Almost everybody at this point now in our lives, everybody that we know has written and software and the feeling of power you get when you've created a program, you're like, I'm changing the world.
You know, it's like, I'm drawing a snake on the screen, but I did that, you know, and like that sense of like, I'm the master of this tiny universe.
And I feel that's one of the things that embedded stuff is really good for because not only am I affecting just pixels on my screen, but I'm actually causing things to move in real world, you know, or I'm causing a thing to sense the real world, and that's super powerful.
I agree.
That's one reason why I love it.
I mean, everyone always uses the example of the first time you get something to blink on a microcontroller, but there is awe and wonder the first time you get it to blink on a microcontroller.
(laughing) I have the power.
What's your last one for us?
Okay, so you ever wondered about those grid key layouts on some synthesizers or MIDI controllers?
The linear arrangement of a piano is conceptually simple, but it's actually kind of terrible for performance.
If you played a guitar, especially for the lower four strings, you've experienced a 2D note layout that's more intuitive and easier for transposing.
You figure out a chord shape, and that chord shape stays the same as you move it up or down the fretboard.
For keyboard players, we've been seeing an explosion of 2D layouts for these 2D grid instruments like Monom, Launchpad, or my favorite, the SynthStrum Deluge.
They have this more rational guitar-like layout where a specific arrangement of buttons can mean a major chord or a minor chord, and you can play that arrangement kind of anywhere, depending on where you kind of want the sound to be in terms of its pitch.
And since they're still linear, like for each row, it makes sense when you're coming from a piano.
But is there even better layout, better for performance that has some music theory baked in to make playing even easier?
And the answer is yes.
There is a layout called the harmonic table note layout.
This layout has the keys in a hexagonal grid, but not linearly as grid instruments.
Instead, these notes are spaced according to a tonnet, or tonnets in German, where notes are arranged how they relate harmonically to each other.
This was originally devised by Leonard Euler in the 1700s.
It's kind of cool that like there's something from so far in the past that can be modernly useful in terms of alternate instrument layout.
So how do you use this?
So imagine a hexagon grid.
Pick any hexagon in that grid and that's your root note, like C.
The hexagon right above is the perfect fifth above the root, so like G.
And the hexagons to the left or right of your root is either the minor third or the major third.
So it sounds a little bit confusing, but it's really easy to play a chord.
Just play that C, your root note, the G right above it, and then pick if you wanna go the left or the right to play a major or minor chord.
And because everything is grouped together, like all these hexagons are touching each other, you can actually play a whole chord with one finger by just going at the intersection of where those three hexagons meet.
And BOMP, you can play a major chord, or BOMP, you can play a minor chord.
It's a really wild layout.
I've been wanting to build a MIDI controller around this idea for a while.
I keep forgetting about it 'cause it's like, there's so many cool things to work on.
But just recently I came across a post from the maker of the Teensy microcontrollers, PGRC, posted a really nice build of a harmonic MIDI controller using key switches.
It's got some other tricks like velocity sensitivity for computer key switches that I want to look into as well.
I think I might talk about that in a future episode.
And if you're looking to play with this weird hexagonal layout right now, there's a web-based keyboard called Harmo app in the notes that you can kind of try it out.
It's not as fun as like a real thing because you just have the single mouse pointer as opposed to like all 10 of your fingers, but it gives you the idea of kind of where the notes, like kind of how the notes relate to each other.
And there was a physical MIDI controller called the Axis that you can find on eBay and Reverb.
And it has like kind of all the features of this thing as well.
And so I'm wondering, should I make a harmonic table controller using a Pico and CapTouch like my other little CapTouch mini controllers?
(laughs) So maybe that might come in the future, I don't know.
But it's like, it was so fun to watch some of the videos.
I'll include some links in the show notes of websites that have some videos of people playing and you can play really smoothly and fastly on this new layout.
Have you updated your Synthstrom deluge new layout?
See, I'm not sure if you can map the hexagon grid to a rectangular grid because the Deluge has a rectangular grid and you can sort of say that the hexagonal grid is sort of a sheared version of a rectangular grid but I don't know I think it might be better just to have a separate box that is the hexagonal buttons feeding into the Deluge.
Sure.
All right Paul, so what's your third one for this time?
Thanks to Mastodon user GeekandDad I is a board game for players 8 and up to build mechanical circuits to solve puzzles.
I love the description on their webpage.
Feel the pull of voltage and see the flow of current.
Electronics is abstract, but Spintronics makes circuits tangible, irresistibly touchable, and deeply intuitive.
There are three game components available for purchase.
Act 1 is about $85 and introduces basic concepts including series and parallel, capacitor circuits, logic circuits, and more.
Act 2 introduces the transistor and the inductor with intermediate and advanced concepts like amplification, power conversion, feedback, and oscillators.
I briefly went through a board game phase with my kids, who unfortunately are grown and gone, but I would have totally bought this.
You know, I probably still don't know half of these concepts myself.
Now if you're into board games, you know that things aren't cheap and Spintronics is no exception.
You can get a bundle of Act 1 and Act 2 for about $150 or add the power pack and get all three for about 180.
If you visit their store, they also have replacement parts, including batteries, chains, resistors, and the list goes on.
And the second company this year after micro critter that we featured in the podcast that's local to me, their headquartered in St.
Paul, Minnesota.
So that's kind of cool.
Oh, neat.
Yeah.
Yeah, we're not really known as a maker hub.
But you know, two things this year.
So that's kind of kind of neat.
Yeah, this this is really fascinating.
It's like, when you're when you're taught, you know, like, I went to school for electronics, basically.
And so there's a lot of these analogies you hear, like one of the most common is the water analogy, you know, like the amount of water is like the amount of current in a circuit, etc, etc.
This is all mechanical, it's like gears and stuff.
I think that's really fascinating that like, oh, if you want to, you know, if you want to show how a parallel circuit works, you have like a gear train with two sprockets and going off to driving one one thing or whatever.
And there's like a resistor sprocket that has like, I think a spring in it or something that sort of resist turning.
And so I find the mechanisms themselves fascinating.
It's like, how are they translating these concepts?
And like, what are these mechanisms doing?
As someone who doesn't know mechanical engineering at all, it's like, well, I know electronics.
And so I really want to see how these mechanisms work.
And if, you know, cost might be prohibitive for some, but when you look at the parts that are included, like you're talking about, I can see how it easily adds up to that.
Oh yeah, 'cause like each little thing, like, "Oh, here's a Spintronic capacitor and it's got like a little display and a spring and it's also a sprocket of some kind." Yeah, I mean, each one is a complicated little item in and of itself.
It's fascinating.
Well, that's our show.
For detailed show notes and transcripts, visit thebootloader.net.
And until next time, stay positive.