FYI, I've added a feature to DOSBox Staging that corrects the raw MIDI stream by sending explicit Note Off messages for all currently playing notes when an All Notes Off message is encountered. This is stipulated by the MIDI standard in absolutely no uncertain terms, and a significant number of DOS game MIDI drivers can be considered violating the MIDI standard because they only send All Notes Off events.
This means that the latest DOSBox Staging build will play all MIDI correctly without hanging notes on the Roland RA-50. Btw, I've introduced this feature so that the capture function generates clean MIDI data, because editing long MIDI streams with no Note Offs is error-prone and a total nightmare, plus it can result in missing notes, depending on how the MIDI sequencer you use interprets multiple successive Note On events.
It's controlled by the newly introduced `raw_midi` option which is false by default. See details about the feature here:
https://github.com/dosbox-staging/dosbox-staging/pull/2318
DOS: Soyo SY-5TF, MMX 200, 128MB, S3 Virge DX, ESS 1868F, AWE32, QWave, S2, McFly, SC-55, MU80, MP32L
Win98: Gigabyte K8VM800M, Athlon64 3200+, 512MB, Matrox G400, SB Live
WinXP: Gigabyte P31-DS3L, C2D 2.33 GHz, 2GB, GT 430, Audigy 4