Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

USB MIDI Synthesizer – STM32C071 and TinyUSB | STM32 Tutorial #97

367 views on YouTube

In this video we will implement a (pretty shitty) USB MIDI device acting like a simple synthesizer using nothing but PWM and a passive buzzer.

Buy Streamline: https://currentmakers.com/products/streamline/
Buy Streamline MCU STM32C071: https://currentmakers.com/products/streamline/streamline_mcu_stm32c071/

The STM32Cxx series on STM32World wiki: https://stm32world.com/wiki/STM32C0xx_Series

MIDItio project on STM32World wiki: https://stm32world.com/wiki/MIDItio

Join our Discord server: https://discord.com/channels/1347730523824455750/1347730523824455753

The code that inspired this video: https://github.com/sukhjeetsekhon/stm32_musical_buzzer

#STM32 #GettingStarted #Tutorial #MIDI #TinyUSB #USB #STM32CubeIDE #STM32CubeMX #STM32C071 #STM32Cxx #STM32World

00:00 Popcorn Intro
01:10 Welcome
01:30 The background
04:04 The MIDItio Project
05:34 The github repository that inspired this
05:53 The Streamline setup – backplane, programmer and mcu
07:04 The first attempt and why I ditched HAL USB
07:30 HAL USB mini rant!
08:55 The new project using STM32C071 and TinyUSB
09:10 The STM32CubeMX project setup
09:42 Clock configuration – internal 48 MHz clock
11:09 Adding TinyUSB to the project – adding files from TinyUSB src folder
12:17 The interrupt handler call
13:05 The TinyUSB configuration: tud_config.h
14:51 The USB descriptor setup for TinyUSB
16:00 Changes to the main source main.c
16:34 Note frequencies – all integers so a bit of a hack
17:59 The set_frequency function – calculated from frequency and sample frequency
18:49 The buzzer_note_on and buzzer_note_off functions
19:17 The TinyUSB receive callback function
20:32 Initializing TinyUSB
21:53 Flashing and running – USB device show up
22:50 Checking available midi devices with amidi -l
23:37 Running a scale from the CLI – sorry – the audio was not very impressive
24:30 Routing MIDI from LMMS
25:11 Routing the popcorn track
24:40 Final thoughts and outtro

Corrections:
22:15 Buzzer not buffer