Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDI: set minimum sysex delay when enabled #4513

Merged

Conversation

mistydemeo
Copy link
Contributor

@mistydemeo mistydemeo commented Oct 8, 2023

What issue(s) does this PR address?

Fixes #4506.

Does this PR introduce new feature(s)?

No

Does this PR introduce any breaking change(s)?

No

Additional information

A real rev.0 MT-32 is the main system that needs the sysex delay, and it needs about 40ms between sysex commands to work properly. 40ms is documented in a few blogs online and is the delay used universally by ScummVM. In testing, a sub-40 value appeared to work sometimes but always using 40 should be safest.

Reviewing the original delaysysex patch, the case that's leading to incorrect timing here is a new case in the if statement that wasn't in the original patch. It's possible this bug was introduced later, or that the patch as merged wasn't entirely comprehensive enough.

Tested with MEdit, which was written for LAPC-I/CL-32L; with this patch, loading problematic songs (such as One Step Beyond's INGAME1.RLD) now works, whereas they reliably triggered a buffer overflow before.

A real rev.0 MT-32 is the main system that needs the sysex delay, and
it needs about 40ms between sysex commands to work properly. 40ms is
documented in a few blogs online and is the delay used universally by
ScummVM.

Reviewing the original delaysysex patch, the case that's leading to
incorrect timing here is a new case in the if statement that wasn't in
the original patch. It's possible this bug was introduced later, or that
the patch as written wasn't entirely comprehensive enough.

Tested with MEdit, which was written for LAPC-I/CL-32L; with this patch,
loading problematic songs (such as One Step Beyond's INGAME1.RLD) now
works, whereas they reliably triggered a buffer overflow before.
@mistydemeo mistydemeo force-pushed the delaysysex_minimum_40ms branch from 3d82bd7 to 7dfc613 Compare October 8, 2023 22:43
@joncampbell123 joncampbell123 merged commit 2db873b into joncampbell123:master Oct 9, 2023
@mistydemeo mistydemeo deleted the delaysysex_minimum_40ms branch October 9, 2023 04:49
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.

Possibility to slow down sysex even further than via delaysysex
2 participants