Skip to content

Fix UMP translations - #34

Merged
starfishmod merged 2 commits into
midi2-dev:mainfrom
sauloverissimo:fix/ump-translation-correctness
Jul 13, 2026
Merged

Fix UMP translations#34
starfishmod merged 2 commits into
midi2-dev:mainfrom
sauloverissimo:fix/ump-translation-correctness

Conversation

@sauloverissimo

@sauloverissimo sauloverissimo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Three fixes in the translation layer, each with a test. Independent commits.

  1. MDS decode (umpProcessor): the MDS ID is read from word[1] instead of word[0], in both Header and Payload. The Payload call is also guarded by the Header pointer (if(mds5Header)mds5Payload), so it never fires on its own.

  2. Cross-group (N)RPN (umpToBytestream, Ref umpToBytestream doesn't take group into account for RPN/NRPN caching logic #30): the cache is keyed by channel only. A cheap fix for umpToBytestream doesn't take group into account for RPN/NRPN caching logic #30: instead of per-Group arrays, reset the cache when the Group changes (1 byte). Single-group and setFilterGroup output stays identical. If you'd rather just document it, leave this commit out.

  3. Running status (umpToBytestream): it wasn't cancelled after System Common or SysEx. Fixed, preserving Real Time.

I tested each fix by reproducing the bug before the change and checking the byte output after; full suite green. @starfishmod

@starfishmod

Copy link
Copy Markdown
Member

@sauloverissimo thanks for these - I'm really happy you found them.

The CrossGroup (N)RPN issue is a problem that I want to think on more - could you move this into a different PR (and then I'll accept the other two fixes).

I want to be careful because MS is using this library in their code and I don't want to break what they are doing. They have picked up on this issue and that is why the UMP group filter was added. Ideally I want a better long term solution here - not sure what it is though :/

@sauloverissimo

Copy link
Copy Markdown
Contributor Author

Moved the (N)RPN fix to #35. This PR is now just the MDS decode and the running-status fix.

@sauloverissimo

sauloverissimo commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Hi @starfishmod Andrew, I completely understand the responsibility. Split it as you asked: the two fixes are in #34 and the cross-group (N)RPN is in #35. #30 is isolated now, so it's your call. 👍

@starfishmod
starfishmod merged commit f41f9ff into midi2-dev:main Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants