

MIDI2USBConv
Open source MIDI2.0 Converter
- Size
- 50 × 30 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 47
- Nets
- 72
- Pads
- 211
- Tracks, vias
- 590, 109
- Pours
- 2
- Routed
- Yes
- KiCad
- KiCad 8.0 (file 20240108)
- Created
- 19 Aug 2025
- Updated
- 2 Mar 2026
Overview
MIDI2USBConv is an open-source printed circuit board by collet-instruments, from the collet-instruments/MIDI2USB-Converter repository on GitHub, published under the MIT licence. It is a 2-layer board of 50 × 30 mm with 47 parts on 72 nets, routed with 590 tracks and 109 vias.
It is built around the STM32F401CBU6, USBLC6-2SC6 and 1N4148WS. Its parts include 16 resistors, 12 capacitors, 6 diodes, 4 ICs and 4 connectors. It belongs with the STM32 boards of this library.
Main components
3STM32F401CBU6
UFQFPN-48(7x7)-40℃~+85℃ 1.7V~3.6V 128KB 12bit 32 Bit 36 64KB 84MHz ARM Cortex-M4 Built-in FLASH UFQFPN-48(7x7) Microcontrollers (MCU/MPU/SOC) ROHSSTMicroelectronicsMicrocontrollers (MCU/MPU/SOC)USBLC6-2SC6
SOT-23-60.35pF、0.8pF 100nA 150W@8/20us 15V 2 5V 6A@8/20us 6V ESD SOT-23-6 ESD and Surge Protection (TVS/ESD) ROHSUMWESD And Surge Protection (TVS/ESD)1N4148WS
SOD-3231.25V@150mA 100V 150mA 1uA@75V 200mW 2A 4ns Independent SOD-323 Switching Diodes ROHSJiangsu Changjing Electronics Technology (CJ)Switching Diodes
README
README.md🎹 MIDI2USB Converter
STM32F401-based USB MIDI converter supporting both MIDI 1.0 and MIDI 2.0 protocols.
✨ Features
- 🎵 Dual Protocol Support: MIDI 1.0 and MIDI 2.0 protocols
- 🔌 USB Device Classes:
- MIDI 1.0: Standard USB MIDI Class
- MIDI 2.0: USB MIDI 2.0 Class with UMP support
- 🔄 Dynamic Mode Switching: Automatic detection based on SETUP switch
- 📦 UMP (Universal MIDI Packet): Full support for MIDI 2.0 messaging
- 🔍 MIDI-CI: MIDI-CI v1.2 support
- 💡 Visual Feedback: LED status indicators
- Red LED: USB MIDI 1.0 mode indicator
- Blue LED: USB MIDI 2.0 mode indicator
- ⚡ Real-time OS: FreeRTOS-based multitasking
- 🔗 UART Bridge: Hardware TRS MIDI Type-A (3.5mm jack) interface support
📖 Usage
Using USB MIDI1.0 Mode
- Switch SETUP (SW1) to MIDI1.0 and connect the USB Type-C port (J1) to a USB host
- The red LED (D5) will light up
- MIDI packets received at the MIDI IN port (J3) will be sent to the USB host
- Similarly, MIDI packets sent from the USB host will be output to the MIDI OUT port (J4)
- Data transfer status can be monitored via indicator LEDs (D2, D3) for both MIDI IN and MIDI OUT ports
Using USB MIDI2.0 Mode
- Switch SETUP (SW1) to MIDI2.0 and connect the USB Type-C port (J1) to a USB host
- The blue LED (D6) will light up
- MIDI packets (MIDI1.0 byte stream) received at the MIDI IN port (J3) are converted to USB MIDI2.0 UMP (Universal MIDI Packet) and sent to the USB host
- At this time, MIDI1.0 Voice Messages are extended to MIDI2.0 Protocol (UMP Message Type 4)
- Similarly, MIDI2.0 UMP sent from the USB host is converted to MIDI1.0 byte stream and output to the MIDI OUT port (J4)
- Since MIDI2.0 Protocol sent from the USB host is converted to MIDI1.0 Protocol, some data may be lost
- Data transfer status can be monitored via indicator LEDs (D2, D3) for both MIDI IN and MIDI OUT ports
- Some operating systems do not support USB MIDI2.0 drivers, in which case MIDI2.0 mode may not be available. Please use MIDI1.0 mode in such cases.
🔄 Protocol Conversion Rules
MIDI 1.0 → MIDI 2.0 Conversion
The converter performs a 2-stage conversion process:
- Stage 1: MIDI 1.0 byte stream → UMP (MIDI 1.0 Protocol)
- Stage 2: UMP (MIDI 1.0 Protocol) → UMP (MIDI 2.0 Protocol)
Key transformations:
- Resolution Enhancement: 7-bit values are scaled up to 16-bit or 32-bit
- Note velocity: 7-bit → 16-bit (e.g., 127 → ~65024)
- Control Change values: 7-bit → 32-bit
- Pitch Bend: 14-bit → 32-bit
- Message Type: Voice Messages are upgraded to UMP Message Type 4 (MIDI 2.0 Protocol)
MIDI 2.0 → MIDI 1.0 Conversion
Direct conversion from UMP to MIDI 1.0 byte stream:
Key transformations:
- Resolution Reduction: High-resolution values are scaled down
- Control values: 32-bit → 7-bit
- Special handling for Note On velocity 0:
- In MIDI 2.0, Note On with velocity 0 remains a Note On
- During conversion, velocity 0 is changed to 1 to prevent unintended Note Off behavior in MIDI 1.0
- Data Loss: MIDI 2.0-specific features (extended CC, per-note controllers) cannot be represented in MIDI 1.0
Conversion Examples
-
MIDI 1.0 Note On:
90 3C 64(Ch1, Middle C, Velocity 100) → MIDI 2.0 UMP:40902C00 32800000(Velocity ≈ 51200) -
MIDI 2.0 Note On: Velocity 32768 (50% intensity) → MIDI 1.0:
90 3C 40(Velocity 64, precision reduced)
⚠️ Caution
- The IN/OUT terminals of this product are TRS MIDI Type-A only. Do not use other types of cables.
- Make sure not to confuse IN and OUT connections. Incorrect wiring may cause reverse current and damage your equipment.
- This product is designed for USB Type-C 5V power supply only. Do not apply any other voltage.
- The product may be damaged by static electricity. Please handle with proper ESD precautions.
- Modifications or improper soldering may cause malfunction or accidents.
- Do not use in environments with high temperature, high humidity, direct sunlight, or condensation.
- Compatibility with all MIDI devices is not guaranteed.
📜 Disclaimer
- This product is provided for electronic hobby, educational, and research purposes.
- It is not a consumer-ready product and has not been certified under any safety standards or regulations (such as PSE, Radio Act certification, CE, UL, etc.).
- By purchasing and using this product, you agree to the following terms:
Use at Your Own Risk
- We accept no responsibility for any damage to equipment, personal injury, fire, data loss, or any other loss or accident resulting from the use of this product.
Limitations of Use
- Do not use this product in industrial equipment, medical devices, safety systems, or any other applications where human life or property may be at risk.
- Continuous long-term operation or use under heavy loads is not intended.
Modification and Connections
- We are not responsible for any malfunction or damage caused by modification of this product or connection to unintended devices.
Returns and Warranty
- If a manufacturing defect is confirmed, we will provide a replacement or refund.
- No other warranties or guarantees are offered.
⚙️ Modification and Collaboration
-
This product is provided as open hardware.
You are free to modify, reuse, or build upon the circuit and firmware.
However, we cannot guarantee the operation or safety of modified versions. -
We welcome contributions from developers and users who wish to improve the design.
Please feel free to share feedback, modifications, or enhancement ideas.
🛠️ Build Requirements
- ARM GCC toolchain (arm-none-eabi-gcc)
- CMake (3.22 or later)
- Ninja build system
- Git (for submodules)
📥 Getting Started
Clone the Repository
git clone --recursive https://github.com/collet-instruments/MIDI2USB-Converter.git
cd MIDI2USB-Converter
# If you already cloned without --recursive, initialize submodules
git submodule init
git submodule updateIDE Integration
VS Code: Use CMake extension for building and debugging with ST-Link.
- STM32 VS Code extension makes setup easy.
🔨 Building
Using CMake
# Configure the project
cmake --preset Debug
# Build the firmware
cmake --build --preset Debug
# The output files will be in build/Debug/Build Configurations
The project supports multiple build configurations:
- Debug: Development build with debug symbols (default)
- Release: Optimized build for production (-O2 optimization)
- RelWithDebInfo: Release build with debug info
- MinSizeRel: Size-optimized build (-Os optimization)
🧪 Testing
The project includes a comprehensive unit test suite using Unity framework.
Running Tests
# Run all tests
cd test
make test
# Run specific test
make test-mode_manager
# Run tests with coverage
make clean
make COVERAGE=1
make test✅ Code Quality
Code Formatting
The project uses clang-format for code formatting. Configuration is in .clang-format.
# Format code
clang-format -i Core/Src/*.c Core/Inc/*.h
# Check formatting without modifying files
clang-format --dry-run --Werror Core/Src/*.c Core/Inc/*.hStatic Analysis
# Run cppcheck
cppcheck --enable=warning,style,performance,portability \
-I Core/Inc \
Core/Src/CI/CD
GitHub Actions automatically runs on every push and pull request:
Workflows:
-
ci.yml: Main CI pipeline
- Builds STM32 firmware
- Runs all unit tests
- Uploads firmware artifacts
-
code-quality.yml: Code quality checks
- Static analysis with cppcheck
- Code formatting verification with clang-format
-
release.yml: Automated releases
- Triggers on version tags (v*)
- Creates GitHub releases with firmware binaries
📁 Project Structure
├── Core/ # Application source code
├── Drivers/ # STM32 HAL and CMSIS drivers
├── submodules/ # External dependencies
│ ├── FreeRTOS-Kernel/
│ ├── tinyusb/
│ ├── AM_MIDI2.0Lib/
│ ├── tusb_ump/
│ └── Unity/
├── test/ # Unit tests (Unity framework)
│ ├── src/ # Test source files
│ ├── mock/ # Mock implementations
│ └── include/ # Test headers
├── ci/ # CI/CD scripts
└── .github/ # CI/CD workflows📦 Submodules
This project uses the following Git submodules:
| Submodule | Repository URL | Description |
|---|---|---|
| FreeRTOS-Kernel | https://github.com/FreeRTOS/FreeRTOS-Kernel.git | FreeRTOS kernel files only |
| tinyusb | https://github.com/hathach/tinyusb.git | An open source cross-platform USB stack for embedded system |
| tusb_ump | https://github.com/midi2-dev/tusb_ump | USB MIDI 2.0 tinyUSB Device driver with backwards compatibility to USB MIDI 1.0 |
| AM_MIDI2.0Lib | https://github.com/midi2-dev/AM_MIDI2.0Lib | A MIDI 2.0 C++ Library |
| Unity | https://github.com/ThrowTheSwitch/Unity.git | Simple unit testing for C |
🔧 Hardware
🎛️ Microcontroller
- MCU: STM32F401CBU6 (ARM Cortex-M4, 84MHz)
- Flash: 256KB
- RAM: 64KB
🔌 Interfaces
- USB: Full-Speed USB 2.0 (12Mbps)
- UART: MIDI serial interface (31.25 kbaud)
- TX: PA2 (USART2_TX)
- RX: PA3 (USART2_RX)
- DEBUG: ST-Link support (J2 connector)
📍 GPIO Pins
- Mode Selection: PA5 (SETUP pin)
- High: USB MIDI 2.0 mode
- Low: USB MIDI 1.0 mode
- LEDs:
- M1LED: PA4 - USB MIDI 1.0 mode indicator
- M2LED: PA6 - USB MIDI 2.0 mode indicator
⚡ Power
- Powered via USB (5V)
- 3.3V internal operation
💻 Development
Running Tests Locally
# Quick test before pushing
./ci/test-ci-locally.sh
# Install optional CI tools
./ci/install-ci-tools.shDebugging
- VS Code: Use CMake extension and ST-Link for debugging
- OpenOCD: Manual debugging with GDB
- Connect the J2 connector (NRST, SYS_SWCLK, SYS_SWDIO) to ST-Link for debugging. USART1 is also available for printf debugging.
🤝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for details on:
- How to submit issues
- How to submit pull requests
- Code style guidelines
- Development setup
📜 Code of Conduct
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please see CODE_OF_CONDUCT.md for details.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Hardware Design: All hardware design files including schematics, PCB layouts, and manufacturing files in the hardware/ directory are also covered under the same MIT License.
Third-party Licenses
This project uses the following open-source libraries:
- FreeRTOS-Kernel: MIT License
- TinyUSB: MIT License
- AM_MIDI2.0Lib: MIT License
- Unity Test Framework: MIT License
- STM32 HAL Drivers: BSD 3-Clause License (STMicroelectronics)
👥 Authors and Acknowledgments
- USB MIDI 2.0 implementation based on TinyUSB and AM_MIDI2.0Lib
- STM32 HAL drivers by STMicroelectronics
- Special thanks to all contributors
💬 Support
For questions and support:
- Open an issue on GitHub
- Check existing issues and discussions
- See documentation in the repository
📝 Copyright
Copyright © 2025 Collet Instruments. All rights reserved.
Parts
47| Qty | Value | Footprint | References |
|---|---|---|---|
| 7 | 0.1u | Capacitor_SMD:C_0402_1005Metric | C1, C5, C6, C7, C8, C10, C11 |
| 3 | 1.5k | Resistor_SMD:R_0402_1005Metric | R9, R15, R16 |
| 3 | 1k | Resistor_SMD:R_0402_1005Metric | R1, R2, R3 |
| 3 | Green | LED_SMD:LED_0402_1005Metric | D1, D2, D3 |
| 2 | 100 | Resistor_SMD:R_0402_1005Metric | R11, R12 |
| 2 | 10k | Resistor_SMD:R_0402_1005Metric | R7, R8 |
| 2 | 10u | Capacitor_SMD:C_0603_1608Metric | C2, C3 |
| 2 | 5.1k | Resistor_SMD:R_0402_1005Metric | R4, R5 |
| 2 | AudioJack4 | Connector_Audio:Jack_3.5mm_PJ320D_Horizontal | J3, J4 |
| 1 | 10 | Resistor_SMD:R_0805_2012Metric | R14 |
| 1 | 1M | Resistor_SMD:R_0402_1005Metric | R6 |
| 1 | 1N4148WS | Diode_SMD:D_SOD-323 | D4 |
| 1 | 2.2u | Capacitor_SMD:C_0603_1608Metric | C13 |
| 1 | 220 | Resistor_SMD:R_0402_1005Metric | R10 |
| 1 | 33 | Resistor_SMD:R_0805_2012Metric | R13 |
| 1 | 4.7nF | Capacitor_SMD:C_0402_1005Metric | C9 |
| 1 | 4.7u | Capacitor_SMD:C_0603_1608Metric | C4 |
| 1 | 6V 2.0A | Fuse:Fuse_1206_3216Metric | F1 |
| 1 | 8MHz | Crystal:Resonator_SMD_Murata_CSTxExxV-3Pin_3.0x1.1mm | Y1 |
| 1 | Blue | LED_SMD:LED_0402_1005Metric | D6 |
| 1 | Conn_ST_STDC14 | STDC14_SMD:STDC14_SMD | J2 |
| 1 | LOGO | logo:midi2usb_logo | G*** |
| 1 | NCP1117-3.3_SOT223 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U1 |
| 1 | Red | LED_SMD:LED_0402_1005Metric | D5 |
| 1 | STM32F401CBU6 | Package_DFN_QFN:QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm | U3 |
| 1 | SW_SPDT_312 | Button_Switch_SMD:SW_SPDT_PCM12 | SW1 |
| 1 | TLP2768A(D4-TP,E(T | Package_SO:SO-6L_10x3.84mm_P1.27mm | U4 |
| 1 | USBLC6-2SC6 | Package_TO_SOT_SMD:SOT-23-6 | U2 |
| 1 | USB_C_Receptacle_USB2.0_16P | Connector_USB:USB_C_Receptacle_G-Switch_GT-USB-7010ASV | J1 |
The 46 most common of 47 parts.
Questions
How big is the MIDI2USBConv PCB?
It measures 50 × 30 mm and has 2 copper layers, 1.6 mm thick.
What parts does the MIDI2USBConv use?
47 parts, built around the STM32F401CBU6, USBLC6-2SC6 and 1N4148WS. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the MIDI2USBConv KiCad files?
From the collet-instruments/MIDI2USB-Converter repository on GitHub, at the commit this page was made from: the board is hardware/kicad8/MIDI2USBConv.kicad_pcb and its schematic hardware/kicad8/MIDI2USBConv.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the MIDI2USBConv design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).
Similar boards
- 4 layers90.3 × 94.6 mm

- 2 layers300 × 100.8 mm

- 2 layers134 × 88 mm

Tulipcc
shorepine/tulipcc
The Tulip Creative Computer and AMYboard - portable Python synthesizers
103 parts978 - 2 layers132 × 90.7 mm

Dao choc ble right
Mposiblee/Zireael
The keyboard is based on Dao Chok BLE. The locations of components on the board have been changed, space for the battery has been added, and the thumb cluster has also been changed.
79 parts42CERN-OHL-P-2.0 - 4 layers66.4 × 66.4 mm

Rera
fdiwth/tvc-drone
This repository contains the documentation, hardware designs, and source code for a Thrust Vector Control (TVC) drone.
140 parts34GPL-3.0 - 4 layers40 × 58.5 mm

- 4 layers71.9 × 94 mm

Thumbdeck right
neuman/gripster
thumbdeck — wireless split thumb keyboard (nRF52840 + ZMK, BLE split, i8+-inspired). Layout converged & graded PASS.
114 parts11Apache-2.0 - 2 layers102.4 × 102.4 mm

Generator 5351 rect sine
MR-DOS/generator_5351_rect_sine
Rectangular and sine generator with Si5351 working up to 200 MHz
284 parts6GPL-3.0