Skip to content

Commit aee4776

Browse files
release: v0.4.0
Track midi2 v0.4.0. Public Device / Host / Bridge APIs stay source-compatible where possible; sendFbInfo gains a uiHint argument to match the new spec field. Changes: - Device::sendFbInfo gains uiHint between direction and firstGroup. - FbInfoCb typedef gains uiHint between direction and firstGroup. - Device::sendStreamConfigNotify auto-populates JR_TX_ENABLE from the heartbeat state. - Device::sendNoteOn / sendNoteOff carry the full 16-bit attribute_data. - Device::sendTimeSignature gains optional num32ndNotes (default 8). - Device::sendJRClock / sendJRTimestamp keep the leading group argument; the value is ignored on the wire. - Host::JrTimestampCb keeps (idx, group, ts); group is always 0. Manifests bump to 0.4.0 and depend on midi2 >= 0.4.0.
1 parent d69f73a commit aee4776

13 files changed

Lines changed: 132 additions & 117 deletions

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ All notable changes to `midi2cpp` 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+
## [0.4.0]
9+
10+
Track midi2 v0.4.0. Public Device / Host / Bridge APIs stay
11+
source-compatible where possible; `sendFbInfo` gains a `uiHint`
12+
argument to match the new spec field.
13+
14+
### Changed
15+
16+
- Depends on `midi2 >= 0.4.0`.
17+
- `Device::sendFbInfo(...)` gains `uiHint` between `direction` and
18+
`firstGroup`. Recipes must update their callsite.
19+
- `FbInfoCb` typedef gains `uiHint` between `direction` and
20+
`firstGroup` (recipes that wire `onFbInfo` directly must update).
21+
- `Device::sendStreamConfigNotify(protocol)` now auto-populates the
22+
`JR_TX_ENABLE` bit from the JR Heartbeat state. No API change.
23+
- `Device::sendNoteOn` / `sendNoteOff` no longer refuse `attrData > 0xFF`;
24+
the full 16-bit attribute_data round-trips through midi2 v0.4.0.
25+
- `Device::sendTimeSignature` gains an optional `num32ndNotes`
26+
parameter (default `8`, SMF1 standard).
27+
- `Device::sendJRClock` / `sendJRTimestamp` keep the leading `group`
28+
argument; value is now ignored on the wire (MT 0x0 is Groupless).
29+
- `Host::JrTimestampCb` keeps `(idx, group, ts)`; `group` is always
30+
`0`.
31+
832
## [0.3.1]
933

1034
ESP Component Registry support. midi2cpp now ships an `idf_component.yml`

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if(ESP_PLATFORM)
2020
return()
2121
endif()
2222

23-
project(midi2cpp VERSION 0.3.1 LANGUAGES C CXX)
23+
project(midi2cpp VERSION 0.4.0 LANGUAGES C CXX)
2424

2525
set(CMAKE_C_STANDARD 99)
2626
set(CMAKE_C_STANDARD_REQUIRED ON)
@@ -34,12 +34,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
3434
# This is the same pattern the midi2 README documents for downstream
3535
# consumers, applied to midi2cpp itself.
3636
if(NOT TARGET midi2)
37-
find_package(midi2 0.3.4 QUIET CONFIG)
37+
find_package(midi2 0.4.0 QUIET CONFIG)
3838
if(NOT midi2_FOUND)
3939
include(FetchContent)
4040
FetchContent_Declare(midi2
4141
GIT_REPOSITORY https://github.com/sauloverissimo/midi2.git
42-
GIT_TAG v0.3.4
42+
GIT_TAG v0.4.0
4343
)
4444
FetchContent_MakeAvailable(midi2)
4545
endif()

README.md

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![release](https://img.shields.io/github/v/release/sauloverissimo/midi2cpp.svg)](https://github.com/sauloverissimo/midi2cpp/releases/latest)
1010
[![C++17](https://img.shields.io/badge/C%2B%2B-17-00599C.svg)](https://en.cppreference.com/cpp/compiler_support)
1111
[![MIDI 2.0](https://img.shields.io/badge/MIDI-2.0-blueviolet.svg)](https://midi.org/specifications/midi-2-0-specifications)
12-
[![depends: midi2](https://img.shields.io/badge/depends-midi2_%E2%89%A5_0.3.4-blueviolet.svg)](https://github.com/sauloverissimo/midi2)
12+
[![depends: midi2](https://img.shields.io/badge/depends-midi2_%E2%89%A5_0.4.0-blueviolet.svg)](https://github.com/sauloverissimo/midi2)
1313
[![Arduino](https://img.shields.io/badge/Arduino-IDE-00979D.svg)](https://www.arduino.cc/)
1414
[![PlatformIO](https://img.shields.io/badge/PlatformIO-Registry-FF7F00.svg)](https://registry.platformio.org/libraries/sauloverissimo/midi2cpp)
1515
[![ESP-IDF](https://img.shields.io/badge/ESP--IDF-v5.4-E7352C.svg)](https://docs.espressif.com/projects/esp-idf/en/stable/)
@@ -26,13 +26,14 @@ midi2cpp is the layer where a sketch meets the protocol. Plug a board into the l
2626

2727
Underneath, [midi2](https://github.com/sauloverissimo/midi2) (the portable C99 core) handles parsing, dispatch, and reassembly. midi2cpp adds the C++ ergonomics: callbacks, board glue, ready-made USB descriptors. The board does the talking; the sketch tells it what to say.
2828

29+
Single declared dependency: midi2. Transport, clock, and RNG are caller-supplied; no submodules.
30+
2931
## Contents
3032

3133
- [midi2cpp](#midi2cpp)
3234
- [MIDI 2.0 engine for embedded systems](#midi-20-engine-for-embedded-systems)
3335
- [The library](#the-library)
3436
- [Contents](#contents)
35-
- [Dependencies](#dependencies)
3637
- [Quickstart](#quickstart)
3738
- [What you get](#what-you-get)
3839
- [Three shapes](#three-shapes)
@@ -53,26 +54,6 @@ Underneath, [midi2](https://github.com/sauloverissimo/midi2) (the portable C99 c
5354
- [Specifications and trademarks](#specifications-and-trademarks)
5455
- [License](#license)
5556

56-
## Dependencies
57-
58-
midi2cpp draws a clear line between what the library declares and what stays the caller's job:
59-
60-
- **Exactly one declared dependency: [midi2](https://github.com/sauloverissimo/midi2).** The C99 core lives in its own repo, is versioned independently, and is resolved by whichever package manager fits the host build:
61-
- Arduino Library Manager: `depends=midi2 (>=0.3.4)` in `library.properties`.
62-
- PlatformIO Registry: `dependencies."sauloverissimo/midi2": "^0.3.4"` in `library.json`.
63-
- ESP-IDF Component Manager: `idf_component.yml` declaration plus `midi2` in `REQUIRES`.
64-
- CMake: `find_package(midi2 0.3.4 CONFIG)` first, falls back to `FetchContent_Declare(midi2 GIT_TAG v0.3.4)`.
65-
- **No submodules.** `git clone` is the install. No `--recurse-submodules`, no half-initialised state.
66-
- **No transport library pulled in.** TinyUSB, Teensy native USB, PIO-USB, libDaisy USBMidi: all caller-supplied. The library does not include `<Arduino.h>`, `pico/time.h`, `esp_timer.h`, or any USB header.
67-
- **No clock or RNG dependency.** Caller injects `millis` / `time_us_64` / `esp_timer_get_time` and `random` / `get_rand_32` / `esp_random` through public hooks. Unset hooks degrade silently, no missing-symbol link errors.
68-
69-
```bash
70-
git clone https://github.com/sauloverissimo/midi2cpp.git
71-
cmake -B build && cmake --build build && ctest --test-dir build
72-
```
73-
74-
Three commands. The first `cmake configure` pulls midi2 once via FetchContent (or picks it up from a system install via `find_package`); subsequent rebuilds and tests run offline. Anywhere C++17 + CMake reach: Linux, macOS, Windows, embedded cross-toolchains for ARM/RISC-V/Xtensa.
75-
7657
## Quickstart
7758

7859
`midi2cpp` is platform-agnostic: it parses, dispatches, and assembles UMP, and it leaves USB transport, clock, and entropy to the caller. The sketch wires four hooks to its platform's USB MIDI driver; the library does the rest.
@@ -213,14 +194,14 @@ Then install `midi2` via Library Manager (search `midi2`, click Install).
213194
Published on the [PlatformIO Registry](https://registry.platformio.org/libraries/sauloverissimo/midi2cpp):
214195

215196
```ini
216-
lib_deps = sauloverissimo/midi2cpp @ ^0.3.1
197+
lib_deps = sauloverissimo/midi2cpp @ ^0.4.0
217198
```
218199

219200
Or pin by git tag:
220201

221202
```ini
222203
lib_deps =
223-
https://github.com/sauloverissimo/midi2cpp.git#v0.3.1
204+
https://github.com/sauloverissimo/midi2cpp.git#v0.4.0
224205
```
225206

226207
Either way, `midi2` is resolved transitively via the manifest declaration in `library.json`.
@@ -235,7 +216,7 @@ Published on the [ESP Component Registry](https://components.espressif.com/compo
235216
# main/idf_component.yml
236217
dependencies:
237218
idf: ">=5.0"
238-
sauloverissimo/midi2cpp: ">=0.3.1"
219+
sauloverissimo/midi2cpp: ">=0.4.0"
239220
```
240221
241222
`midi2` is pulled transitively through `midi2cpp`'s manifest. `idf.py reconfigure` drops both into `managed_components/`.
@@ -252,7 +233,7 @@ Then declare `midi2` in `main/idf_component.yml`:
252233
```yaml
253234
dependencies:
254235
idf: ">=5.0"
255-
sauloverissimo/midi2: ">=0.3.4"
236+
sauloverissimo/midi2: ">=0.4.0"
256237
```
257238

258239
`main/CMakeLists.txt` lists `midi2cpp` in its `idf_component_register(... REQUIRES midi2cpp ...)` block. The seven ESP-IDF recipes under [`examples/`](examples/) ship working templates for device, host and bridge roles.
@@ -264,12 +245,12 @@ include(FetchContent)
264245
FetchContent_Declare(
265246
midi2cpp
266247
GIT_REPOSITORY https://github.com/sauloverissimo/midi2cpp.git
267-
GIT_TAG v0.3.1
248+
GIT_TAG v0.4.0
268249
)
269250
FetchContent_MakeAvailable(midi2cpp)
270251
```
271252

272-
`midi2cpp` cascades the dependency on `midi2` to the parent project: `find_package(midi2 0.3.4 CONFIG)` is tried first, falling back to `FetchContent_Declare(midi2 GIT_TAG v0.3.4)` if no install is found.
253+
`midi2cpp` cascades the dependency on `midi2` to the parent project: `find_package(midi2 0.4.0 CONFIG)` is tried first, falling back to `FetchContent_Declare(midi2 GIT_TAG v0.4.0)` if no install is found.
273254

274255
### Git submodule
275256

architecture.png

4.51 KB
Loading

idf_component.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
##
77
## # in your_app/main/idf_component.yml
88
## dependencies:
9-
## sauloverissimo/midi2cpp: ">=0.3.1"
9+
## sauloverissimo/midi2cpp: ">=0.4.0"
1010
##
1111
## The Component Manager clones midi2cpp into managed_components/,
1212
## ESP-IDF picks it up as a component because the top-level CMakeLists
@@ -15,7 +15,7 @@
1515
## is declared in the dependencies block below.
1616

1717
description: "C++17 callback-first wrapper for MIDI 2.0 on embedded devices, layered over the portable midi2 C99 library. Covers UMP transport (M2-104), MIDI-CI with Appendix E (M2-101), Property Exchange Subscribe/Notify, Profile Configuration, Process Inquiry, Flex Data, and Bit Scaling (M2-115)."
18-
version: "0.3.1"
18+
version: "0.4.0"
1919
url: "https://github.com/sauloverissimo/midi2cpp"
2020
documentation: "https://github.com/sauloverissimo/midi2cpp#readme"
2121
issues: "https://github.com/sauloverissimo/midi2cpp/issues"
@@ -33,4 +33,4 @@ tags:
3333

3434
dependencies:
3535
idf: ">=5.0"
36-
sauloverissimo/midi2: ">=0.3.4"
36+
sauloverissimo/midi2: ">=0.4.0"

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "midi2cpp",
3-
"version": "0.3.1",
3+
"version": "0.4.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": [
@@ -19,7 +19,7 @@
1919
"url": "https://github.com/sauloverissimo/midi2cpp.git"
2020
},
2121
"dependencies": {
22-
"sauloverissimo/midi2": "^0.3.4"
22+
"sauloverissimo/midi2": "^0.4.0"
2323
},
2424
"headers": "midi2cpp.h",
2525
"export": {

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=midi2cpp
2-
version=0.3.1
2+
version=0.4.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.
@@ -8,4 +8,4 @@ category=Communication
88
url=https://github.com/sauloverissimo/midi2cpp
99
architectures=*
1010
includes=midi2cpp.h
11-
depends=midi2 (>=0.3.4)
11+
depends=midi2 (>=0.4.0)

src/midi2_bridge.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,13 @@ static void forward_ump_to_pc(BridgeState* s, uint8_t idx,
132132
static void push_fb_info(BridgeState* s, uint8_t idx) {
133133
if (idx >= s->numSlots) return;
134134
const uint8_t base = (uint8_t)(idx * s->groupsPerSlot);
135+
// ui_hint=0x03 (Sender+Receiver): bridge slots are always bidirectional —
136+
// the upstream device on the host port can both produce and consume UMP
137+
// relative to the downstream device-side endpoint.
135138
s->device.sendFbInfo(/*active*/ s->slots[idx].active,
136139
/*fb_num*/ idx,
137140
/*direction*/ 0x03,
141+
/*ui_hint*/ 0x03,
138142
/*first_group*/ base,
139143
/*num_groups*/ s->groupsPerSlot,
140144
/*midi_ci_ver*/ 0x02,

0 commit comments

Comments
 (0)