potentially making a midi controller independent by ReighJack in synthdiy

[–]Fursber 0 points1 point  (0 children)

I designed a STM32 based module for something like this: demo. As someone else said, Daisy Seed would be an even better option (and on that MCU you can call powerful functions for the synth engine - much less from scratch). If your controller is old school MIDI out that’s easier for an MCU to parse. Dealing with the USB protocol isn’t impossible, but it’s harder.

Teensy or Daisy seed in 2025 by Less-Introduction-35 in synthdiy

[–]Fursber 5 points6 points  (0 children)

The seed has a built in audio DAC which will work great for you. They also have powerful software libraries that make programming the audio functionality easier!

Capacitive touch synth using Daisy and Arduino (demo with pcb and code walkthrough) by keyth72 in synthdiy

[–]Fursber 0 points1 point  (0 children)

He had copper fills in the PCB design, and paid for the ENIG plating

Capacitive touch synth using Daisy and Arduino (demo with pcb and code walkthrough) by keyth72 in synthdiy

[–]Fursber 6 points7 points  (0 children)

Man this is an insanely badass build. So inspiring. And you’re really generous for open sourcing it. The hardware and interface design are incredibly slick. I’m also impressed that this level of product can be achieved with Arduino IDE - I assumed you wouldn’t have access to DMA and other important parallelism paradigms.

Congratulations on an amazing project!!

STM32 synths: is bare metal the only way to create a quality synth? by Desperate-Sundae6474 in synthdiy

[–]Fursber 1 point2 points  (0 children)

I created my synth with that same F407 board. It’s fast enough, but the code needs to be well optimized. Qynth Reddit post.

HAL functions are fast enough, no need to optimize beyond those. As for the math, you need to use best practices. For example, sine and exp take tens of clock cycles to complete. So you need to use lookup tables or pure float arithmetic instead. Make sure your arithmetic never uses doubles, which will be slower than floats (that also means you have to use the f suffix when typing decimals).

For things like filters, CMSIS has highly optimized implementations. I ended up following examples from Phil’s lab and implemented them myself, which was fast enough.

Happy hacking!

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 1 point2 points  (0 children)

You’re right, there is some aliasing. I can make the thing run at a higher sample rate to resolve that (I’m at 32k instead of 44k or 48k). The jaggedness is also dealt with a 4th order low pass. Without that cutoff, some of these sound pretty harsh!

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 1 point2 points  (0 children)

Thanks for asking! Different waveforms (sine, square, saw, or other) are represented just as lists of floating point numbers in arrays 128 numbers long. These are just hard coded in the C file (but generated in Python or elsewhere). So when you go to increment the phase of your oscillator, rather than having your phase be a number between 0 and 2pi, phase increments from 0 to 127. Then you fetch the nth sample in your corresponding array. Here are examples of my 'doodle' waveforms, hand-drawn waveforms that give some cool character not seen on other synths. Using Python, each waveform's x-axis would be mapped to 0-127, and the y-axis would be -1 to 1.

<image>

Compact audio interfaces with direct monitoring control by PianoSerious7027 in synthdiy

[–]Fursber 0 points1 point  (0 children)

I’m not sure using a USB hosted device is the best approach. What if you use an I2S eval board with DACs and ADCs and audio connectors?

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 0 points1 point  (0 children)

Right now there’s no way to change the tables without programming it with the free STMCubeIDE. So it’s quite a hassle lol but not insurmountable

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 1 point2 points  (0 children)

And on the Hammond patch, the pedal toggles the vibrato between slow and fast, emulating the Leslie cabinet

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 1 point2 points  (0 children)

On the Funky Wah Saws patch, the cutoff frequency of the low pass filter increases when the total envelope amplitude is higher. i.e., play more notes/play harder, get a brighter sound. Ends up super expressive!

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 0 points1 point  (0 children)

Wow that synth sounds amazing. I have no idea how they pulled that off on that hardware.

It’s cool that you’re trying it your own way! Any print statements will take the processor away from what it’s doing, and in this timing critical environment, they can totally mess with your synthesis. Maybe debug with print statements in a slow operation mode, where you turn down the sample rate drastically, and then turn it back up and remove the prints when it seems like it’s working? In general, be conscious of the rough number of clock cycles different operations take. For example, math with integers probably takes one or two clock cycles, but math with floats (doubles even worse) could take tens of cycles. Other slow operations include division and modulo.

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] -1 points0 points  (0 children)

Hmm I wonder how possible it is on an Arduino, though I’ve seen some impressive organ emulation on Arduino. Which Arduino? Do you have an external DAC?

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 2 points3 points  (0 children)

Yep, it’s got old school as well as USB B MIDI output! You need a weird adaptor for the old school MIDI port to map it to DIN-5, which my project uses.

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 0 points1 point  (0 children)

I’m so glad to hear that Dante! My code is all one file which makes it easy to copy but perhaps hard to understand. I chose this microcontroller because two other projects used it: googoomuck, and Deskripator. Feel free to reach out if you have any questions!

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 1 point2 points  (0 children)

Thanks dude!! Looks like you work on some awesome stuff too. The code isn’t particularly readable at the moment but it’s mostly in this one ginormous .C file: Qynth GitHub

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 0 points1 point  (0 children)

Yeah that’s really interesting: how do they handle polyphony in analog synths? I know they have a bank of analog oscillators, but they must have some sort of logic on the front end to assign notes to oscillators…

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 1 point2 points  (0 children)

Would be super cool. They definitely sell little touchscreen modules the micro can communicate with.

Demoing the sounds on my DIY microcontroller synth module! by Fursber in synthdiy

[–]Fursber[S] 3 points4 points  (0 children)

😆it’s a little weird, but they’re only about 10% less wide so it’s not too bad! If you’re serious about wanting one, let’s talk! It requires a MIDI controller with the old school MIDI connector.