mitxela.com forum
Welcome. Please log in or register.

stm32f103cb synth (a powerful synth)
DAVID Posted: 27 Jun 2019, 05:00 AM
Avatar
I love mcus

Member
Posts: 237
Joined: 10-September 17
As many of you know i have posted lots of midi synth projects in this forum. But none of them had any sort of control (pitch bend, volume, pan, etc.). I started to play with the blue pill a couple of weeks ago and i was surprised of how much power this board has to offer in comparison to the AVR 8 bit mcu´s.
When i got an led to blink with timers i quickly search for a USB midi example, i used hightower70´s USB to Midi converter code (https://github.com/hightower70/MIDIUSB,https://github.com/vkorehov/MIDIUSB). Having done that i wanted to use the power of the blue pill to make a PCM synth and so i did.
It has 8 voices (original sample is 8 bit res, 16khz sample rate) + 2 percussion generators with 6 patches (i could have put more but i got lazy and just put 6),
It has panning meaning that it is stereo, channel volume control, pitch bend and sustain + a mono output or an output for an analog vumeter.
All of this is made with timer1 that is running at 40khz. Sadly the blue pill has no dac so i was forced to use PWM at 40khz wit a resolution of 10 bits.
i made a video and took quite a while to edit it:https://youtu.be/Z8oxVrtKEWA
i put all the links in the description.
IDE that i use: Coocox IDE https://www.softpedia.com/get/Programming/Coding-languages-Compilers/CooCox-CoIDE.shtml
Hope you like it

Last edit by DAVID at 27 Jun 2019, 03:20 PM

-------------
[top]
mit Posted: 27 Jun 2019, 01:14 PM
Avatar
yeah whatever

Admin
Posts: 566
Joined: 4-May 16
Hi, that's really cool stuff. I like the video editing.

It sounds good!

There are thousands of different STM32 chips, the blue pill is the cheapest and most popular, but there are versions which have a built-in DAC you could try. The dev boards for them usually cost about $10 to $15, which is not as cheap as the blue pill but way way cheaper than what most companies charge for dev boards. I just searched and found a page here: https://wiki.stm32duino.com/index.php?title=STM32F103ProductList which says that the STM32F103RC has a DAC so you could try out your code on that one. I don't know how hard it would be though.

Here are some more ideas:

- Make a circuit board for it and order it from china, you could just put header pins and plug the blue pill board into it

- Make a case for it, maybe 3D printed

- Make it battery powered

-------------
[top]
DAVID Posted: 27 Jun 2019, 03:10 PM
Avatar
I love mcus

Member
Posts: 237
Joined: 10-September 17
i will edit the code too so that i can use Serial midi

-------------
[top]
DAVID Posted: 26 Aug 2019, 03:03 AM
Avatar
I love mcus

Member
Posts: 237
Joined: 10-September 17
Ok after quite a while of doing nothing, I finally made a Serial midi version instead of USB so that you can use it without the need of a computer. (Reason being i think Mit´s idea of building a portable midi synth its a great thing)
Since now i don´t have to rely on +135 files I decided to make a Makefile for it so that you can compile it in Linux, Windows and Mac OS X.
Now, since i want to make this a portable synth and only had 1 speaker i remove the panning control. and that gave me 4 more voices (12 in total).
Finally if anyone interested on changing the sample (since after all this synth is a PCM Synth),
I Have included other samples on the "sample.h" file, Now i have also made a tutorial of how to make custom
sample for this project.
I forgot to mentioned that for each channel i have and LED, but i don´t wanted to use 12 io´s of the blue pill, so
i use the Charlieplex method.
Anyway hope you like it.
Video: https://youtu.be/TSGBc3OrFr0
Schematic: https://easyeda.com/elpro/stm32f103cb-serial-midi-synth
Code: https://github.com/theawsomeavr/Stm32-Serial-Midi-Synth
EcodeAudio program: http://highlowtech.org/?p=1963

Last edit by DAVID at 26 Aug 2019, 03:13 AM

-------------
[top]

Sign in to post a reply.