Fix UMP translations - #34
Conversation
|
@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 :/ |
b5cd760 to
2ea2a7a
Compare
|
Moved the (N)RPN fix to #35. This PR is now just the MDS decode and the running-status fix. |
|
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. 👍 |
Three fixes in the translation layer, each with a test. Independent commits.
MDS decode (
umpProcessor): the MDS ID is read fromword[1]instead ofword[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.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 andsetFilterGroupoutput stays identical. If you'd rather just document it, leave this commit out.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