Skip to content

Commit aabd99d

Browse files
release: v0.2.0
Bumps library.properties / library.json / CMakeLists.txt to 0.2.0 and publishes the CHANGELOG entry that consolidates the depends=midi2 migration: vendored src/midi2.{h,c} removed, every example/ recipe migrated to pull midi2 externally (Pico SDK + TinyUSB CMake via FetchContent, ESP-IDF via Component Manager, PlatformIO via lib_deps), m2bridge class extracted with a host-side ASan + UBSan suite, and the honest tagline shift from "zero-allocation" to "static-by-default". This is a breaking release. Pre-v0.2 consumers that vendored midi2_cpp/src/midi2.{h,c} will break; the README "Manual vendor" section now explains the new two-repo layout, and the in-tree recipes demonstrate the four supported package-manager paths. Touches: - library.properties / library.json / CMakeLists.txt: VERSION 0.2.0 - README.md "Manual vendor": rewritten to point at midi2/dist/ - esp32-c6 platformio.ini comment: midi2_cpp/src/midi2.h reference replaced with the lib_deps midi2 entry it now relies on - CHANGELOG.md: [Unreleased] promoted to [0.2.0] with the full Breaking / Added / Changed / Examples sections
1 parent d13a62a commit aabd99d

6 files changed

Lines changed: 113 additions & 40 deletions

File tree

CHANGELOG.md

Lines changed: 105 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,115 @@ All notable changes to `midi2_cpp` are recorded here. Format follows
55
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
66
mirrored from the upstream midi2 C99 policy.
77

8-
## [Unreleased]
8+
## [0.2.0]
99

10-
### Examples / Recipes (added)
10+
Single source of truth for the MIDI 2.0 stack: midi2_cpp no longer
11+
vendors the C99 core and is published as a regular Arduino /
12+
PlatformIO library that depends on midi2 explicitly. Every recipe
13+
under `examples/` was migrated to pull midi2 externally through the
14+
build system that fits its host (FetchContent for Pico SDK + TinyUSB
15+
native CMake, IDF Component Manager for ESP-IDF, lib_deps for
16+
PlatformIO).
1117

12-
- `arduino-nano-esp32-midi2`, Arduino Nano ESP32 (ESP32-S3-MINI-1, PID
13-
0x4093). Full Showcase mirroring `esp32-s3-devkitc-usb-midi2`, single
14-
GPIO LED on D13 / GPIO48 instead of WS2812 (Arduino Nano ESP32 has no
15-
RMT-driven addressable LED in this recipe; the on-board RGB LED on
16-
D14 / D15 / D16 is left untouched).
18+
This is a breaking release. Consumers that previously vendored
19+
`midi2_cpp/src/midi2.{h,c}` directly will break; the migration path
20+
is documented in the manifest below and in the per-build-system
21+
patterns shipped under `examples/`.
22+
23+
### Breaking
24+
25+
- **Vendored `src/midi2.{h,c}` removed.** midi2_cpp now declares
26+
midi2 as an external dependency:
27+
- `library.properties` carries `depends=midi2 (>=0.3.3)`. Arduino
28+
Library Manager auto-installs midi2 when a sketch includes
29+
midi2_cpp.
30+
- `library.json` carries `dependencies."sauloverissimo/midi2":
31+
"^0.3.3"`. PlatformIO resolves midi2 from its registry.
32+
- The root `CMakeLists.txt` exposes a three-layer fallback at the
33+
top (`if(NOT TARGET midi2)` -> `find_package(midi2 0.3.3 CONFIG)`
34+
-> `FetchContent_Declare(midi2 GIT_TAG v0.3.3)`), then links
35+
midi2_cpp `PUBLIC midi2::midi2` so downstream targets see the
36+
C99 core transitively.
37+
38+
### Added
39+
40+
- **`midi2::Bridge` (alias `m2bridge`)**: composes Device + CI + Host
41+
with a multi-Function-Block topology, a per-slot group rewrite
42+
window, dynamic FB names sourced from upstream Endpoint Names, and
43+
a USB-MIDI 1.0 byte-stream uplift path (`feedHostMidi1Bytes`) for
44+
legacy upstream devices that arrive on alt 0. Slot lifecycle via
45+
`slotSetActive(idx, active, alt)`. Reusable across bridge recipes;
46+
the multi-FB Stream Discovery responder lives inside the class so
47+
each new bridge recipe gets it for free.
48+
- **`tests/test_midi2_bridge.cpp`**: 11 host-side sub-tests covering
49+
m2bridge construct/destruct heap balance (50x cycle stress), topology
50+
setter bounds and post-`begin()` lock, group rewrite formula on
51+
slots 0/1/3, out-of-range slot rejection, and the USB-MIDI 1.0
52+
byte-stream uplift path. Compiles and runs clean under
53+
`-fsanitize=address,undefined`.
54+
- `architecture.png` referenced from the README, replacing the
55+
previous inline ASCII layer diagram.
56+
- **CMake entry surface for downstream consumers**: the root
57+
`CMakeLists.txt` follows the same `find_package` -> `FetchContent`
58+
fallback pattern that midi2 itself ships. Subprojects pulling
59+
midi2_cpp via `add_subdirectory` or `FetchContent` skip the
60+
`find_package` step (`if(NOT TARGET midi2)` guard).
61+
62+
### Changed
63+
64+
- **README tagline** drops the `zero-allocation` claim. midi2_cpp
65+
allocates in two narrow places (`m2bridge::begin()` slot tables and
66+
`std::function` callback storage), so the wrapper is now described
67+
as `static-by-default`. The C99 core (midi2) remains strictly
68+
zero-allocation. Same shift applied to the logo and to the
69+
`.intern/decisoes.md` design heritage notes.
70+
- **README "Manual vendor" path** rewritten: pre-v0.2 builds vendored
71+
a single `midi2_cpp/src/midi2.{h,c}` copy; today the consumer
72+
downloads both repositories side by side and adds `midi2/dist/`
73+
plus `midi2_cpp/src/` to its include path.
74+
- **`paragraph` in `library.properties`** rewritten: drops
75+
comparisons with other libraries, focuses on what midi2_cpp itself
76+
ships and the embedded targets validated.
77+
78+
### Examples / Recipes
79+
80+
#### Migrated to depend on midi2 externally (all 20 recipes)
81+
82+
| Build system | Mechanism | Recipes |
83+
|---|---|---|
84+
| Pico SDK | `FetchContent_Declare(midi2 GIT_TAG v0.3.3)` plus `target_link_libraries(midi2_cpp PUBLIC midi2::midi2)` | `rp2040-midi2`, `waveshare-rp2040-midi2`, `sparkfun-promicro-rp2350-midi2`, `waveshare-rp2350-usb-a-midi2`, `waveshare-rp2350-usb-a-bridge-midi2`, `adafruit-feather-rp2040-host-midi2`, `adafruit-feather-rp2040-bridge-midi2`, `rp2040-promicro-ump-test-bench` |
85+
| TinyUSB native CMake | same FetchContent pattern as Pico SDK | `xiao-samd21-midi2`, `nrf52840-promicro-midi2` |
86+
| ESP-IDF | `idf_component.yml` declares `midi2: { git: ..., version: ">=0.3.3" }` and `idf_component_register` lists `midi2` in `REQUIRES` | `arduino-nano-esp32-midi2`, `esp32-s3-devkitc-usb-midi2`, `esp32-p4-devkit-usb-midi2`, `esp32-p4-devkit-host-midi2`, `esp32-p4-devkit-bridge-midi2`, `esp32-p4-devkit-bridge2-midi2`, `t-display-s3-midi2` |
87+
| PlatformIO + ESP32_Host_MIDI | `lib_deps += sauloverissimo/midi2 @ ^0.3.3` | `esp32-c6-devkitc-multi-midi2`, `esp32-s3-devkitc-host-midi2`, `t-display-s3-shield-host-midi2` |
88+
89+
Each recipe drops the `${MIDI2_CPP_ROOT}/src/midi2.c` (or `midi2_c99`
90+
helper library) from its source list. Other midi2_cpp sources
91+
(`midi2_device.cpp`, `midi2_ci.cpp`, `midi2_host.cpp`,
92+
`midi2_bridge.cpp`) keep being compiled inline from the parent tree
93+
via `${MIDI2_CPP_ROOT}/src` until the host helper-library shape is
94+
finalised in a future cycle.
95+
96+
#### New recipes since v0.1.0
97+
98+
- `arduino-nano-esp32-midi2`, Arduino Nano ESP32 (ESP32-S3-MINI-1,
99+
PID 0x4093). Full Showcase mirroring `esp32-s3-devkitc-usb-midi2`;
100+
single GPIO LED on D13 / GPIO48 instead of WS2812.
17101
- `xiao-samd21-midi2`, Seeed Studio XIAO SAMD21 (ATSAMD21G18A, PID
18-
0x40F0). Tier C minimal core: NoteOn/Off + CC + UMP Stream Discovery
19-
+ MIDI-CI Discovery + JR Timestamp heartbeat. Build via TinyUSB
20-
native CMake (`hw/bsp/family_support.cmake` + FetchContent of the
21-
PR #3571 fork at the project's pinned SHA) on top of the upstream
22-
TinyUSB BSP `seeeduino_xiao`. ARM GNU toolchain, no Arduino IDE
23-
involved. First recipe in the project portfolio to use this build
24-
system path; pattern documented in `.intern/decisions.md` D-033.
25-
Hardware validated 2026-04-30: device enumerates `cafe:40F0`,
26-
ALSA shows `Group 1 (Main)`, chromatic walk + 32-bit CC #74 sweep
27-
streaming live. Final size: text 34884 / 256K flash (13%), bss
28-
9832 / 32K SRAM (30%).
102+
0x40F0). Tier C minimal core; first recipe to use the TinyUSB
103+
native CMake build system path. Hardware validated: ALSA `Group 1
104+
(Main)`, chromatic walk + 32-bit CC #74 sweep streaming. Final
105+
size: text 34884 / 256K flash (13%), bss 9832 / 32K SRAM (30%).
29106
- `nrf52840-promicro-midi2`, nRF52840 Pro Micro / Nice!Nano class
30-
boards (PID 0x40F1). Tier B standard subset: Per-Note Pitch Bend
31-
vibrato + chromatic walk + RPN / NRPN / RelRPN / RelNRPN burst +
32-
UMP Stream Discovery + MIDI-CI Discovery + JR Timestamp heartbeat.
33-
Build via the same TinyUSB native CMake path used by
34-
`xiao-samd21-midi2` (BSP `feather_nrf52840_express` upstream, Nice!Nano
35-
shares the same nRF52840 + Adafruit UF2 bootloader region layout +
36-
S140 v6 SoftDevice RAM reservation). Drops the earlier
37-
Adafruit_TinyUSB_Arduino-based attempt that did not work on Seeed /
38-
Nice!Nano cores. Hardware validated 2026-04-30 on Nice!Nano: device
39-
enumerates `cafe:40F1`, ALSA shows `Group 1 (Main)`, full Tier B
40-
cycle streaming live in `aseqdump`. Final size: text 38832 / 1 MB
41-
flash (3.7%), bss 2526 / 256 KB SRAM (1%) — the chip is wildly
42-
oversized for the recipe, leaving room for BLE-MIDI 2.0 +
43-
application code on top.
107+
(PID 0x40F1). Tier B subset: Per-Note Pitch Bend vibrato +
108+
chromatic walk + RPN / NRPN / RelRPN / RelNRPN burst. Same TinyUSB
109+
native CMake build path as the SAMD21 recipe. Hardware validated on
110+
Nice!Nano. Final size: text 38832 / 1 MB flash (3.7%), bss 2526 /
111+
256 KB SRAM (1%).
112+
- `esp32-p4-devkit-bridge2-midi2`, ESP32-P4 dual-stack bridge (PID
113+
0x4095) built on top of `m2bridge`. Carries the same multi-FB
114+
topology as `esp32-p4-devkit-bridge-midi2` but consumes the
115+
reusable Bridge class instead of an inline slot table + Stream
116+
Discovery responder.
44117

45118
## [0.1.0]
46119

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.14)
2-
project(midi2_cpp VERSION 0.1.0 LANGUAGES C CXX)
2+
project(midi2_cpp VERSION 0.2.0 LANGUAGES C CXX)
33

44
set(CMAKE_C_STANDARD 99)
55
set(CMAKE_C_STANDARD_REQUIRED ON)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ git submodule add https://github.com/sauloverissimo/midi2_cpp.git external/midi2
227227

228228
### Manual vendor
229229

230-
Download the repo. Add `src/` to includes. Compile `src/midi2.c`, `src/midi2_device.cpp`, and `src/midi2_ci.cpp` alongside the project. No external links required.
230+
Download the [midi2_cpp](https://github.com/sauloverissimo/midi2_cpp) and [midi2](https://github.com/sauloverissimo/midi2) repositories side by side. Add `midi2/dist/` and `midi2_cpp/src/` to includes. Compile `midi2/dist/midi2.c`, `midi2_cpp/src/midi2_device.cpp`, `midi2_cpp/src/midi2_ci.cpp`, and the host/bridge `.cpp` files you need alongside the project. No package manager required at build time, but the two repos must travel together.
231231

232232
## API at a glance
233233

examples/esp32-c6-devkitc-multi-midi2/pio/platformio.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
;
1414
; Both transports carry MIDI 1.0 byte streams on the wire (that is what
1515
; the BLE-MIDI spec and the ESP-NOW recipe support natively). Bytes are
16-
; uplifted to UMP MT 0x2 in firmware via midi2_conv (vendored in
17-
; midi2_cpp/src/midi2.h) before being handed to the typed midi2::Device
18-
; dispatch path. Outgoing UMP from the showcase loop is downgraded back
19-
; to MIDI 1.0 bytes for the wire side.
16+
; uplifted to UMP MT 0x2 in firmware via midi2_conv (from the midi2 C99
17+
; core pulled through lib_deps) before being handed to the typed
18+
; midi2::Device dispatch path. Outgoing UMP from the showcase loop is
19+
; downgraded back to MIDI 1.0 bytes for the wire side.
2020
;
2121
; No USB device interface is presented; therefore no PID is consumed
2222
; from the project pool. Identity surface is per-transport (BLE service

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "midi2_cpp",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "C++17 Arduino-style wrapper for MIDI 2.0 on embedded devices. Thin wrapper over the portable midi2 C99 library. Covers UMP, MIDI-CI with Appendix E, Profile, PE Subscribe/Notify, Process Inquiry, Flex Data, and Bit Scaling. Targets RP2040, RP2350, Teensy, ESP32 family, nRF52, and SAMD21.",
55
"keywords": "midi, midi2, usb, ump, capability-inquiry, property-exchange, profile",
66
"authors": [

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=midi2_cpp
2-
version=0.1.0
2+
version=0.2.0
33
author=Saulo Verissimo <sauloverissimo@gmail.com>
44
maintainer=Saulo Verissimo <sauloverissimo@gmail.com>
55
sentence=C++17 Arduino-style wrapper for MIDI 2.0 on embedded devices.

0 commit comments

Comments
 (0)