Implement MIDI Input Callback System with UMP Support #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement MIDI Input Callback System with UMP Support
This PR implements the missing MIDI input callback system in the C++ MIDI-CI implementation to handle receiving and processing MIDI-CI discovery reply messages. The implementation ports the
setupInputEventListener(),processMidi1Input(), andprocessUmpInput()logic from the Kotlin ktmidi implementation.Changes Made
New UMP Message Parsing Infrastructure
include/midi-ci/ump/Ump.hpp- UMP message structure and constantssrc/midi-ci/ump/Ump.cpp- UMP message parsing implementationinclude/midi-ci/ump/UmpRetriever.hpp- SysEx data extraction from UMP packetssrc/midi-ci/ump/UmpRetriever.cpp- SysEx7/SysEx8 data retrieval implementationEnhanced CIDeviceManager
tools/ci-tool/src/CIDeviceManager.cpp- Completeprocess_ump_input()implementation with message bufferingtools/ci-tool/include/CIDeviceManager.hpp- Addedsetup_input_event_listener()methodBuild System Updates
src/CMakeLists.txt- Added new UMP source files to build configurationKey Features
UMP Message Support
Message Processing
Callback System
setup_input_event_listener()equivalent ported from KotlinTesting
The implementation follows the existing C++ patterns in the codebase:
Technical Details
The UMP message parsing is based directly on the Kotlin reference implementation but adapted to C++ idioms and memory management. The message buffering for chunked SysEx messages follows the same logic as the Kotlin version but uses C++ containers.
This enables the C++ MIDI-CI implementation to properly receive and process "Reply to Discovery" MIDI-CI messages from connected devices, completing the bidirectional MIDI-CI communication capability.
Link to Devin run: https://app.devin.ai/sessions/4ede00a17db4407e8b62e93f3961e59c
Requested by: Atsushi Eno (atsushieno@gmail.com)