Repository navigation
emuscd, emusc-winmidi: --reset gs|gm locks every device in GS or GM - #21
Merged
Merged
Conversation
The lock keeps a device in GM mode whatever SysEx it is sent, for hosts that offer a GM-only mode. Assisted-by: Claude:claude-opus-5-5
gm powers every device that has a GM mode on in it and locks it there for as long as the daemon runs, across device switches; a device without one runs in GS. Assisted-by: Claude:claude-opus-5-5
Locked in GS, a GM System On resets the device into GS. Without --reset the stream keeps control of the mode. A device without the mode asked for is locked in the other one, and a device with neither runs in its own default; each case prints a notice. has_gs_mode() joins has_gm_mode() so the daemons can tell which lock a device can take. Assisted-by: Claude:claude-opus-5-5
Owner
Author
|
Note that sc88 doesn't have it's GM mode completed yet, this is still a gap in the sc88 support in emuscd. |
# Conflicts: # README.md # emuscd/README.md # emuscd/main.cc # emuscd/main_winmidi.cc
GM System On was refused on the shared firmware port, so the SC-88 had no GM mode. The firmware's handler runs the GS Reset's module reset and then turns Rx.Bank Select off where the GS Reset turns Rx.NRPN on; both switches, and Rx.Bank Select LSB, now gate CC0, CC32 and the NRPN numbers and are writable at 40 1x 23, 24 and 0a. Which devices have the mode is a profile field. Provenance: P-xxxx. Assisted-by: Claude:claude-opus-5-5
device_has_gm_mode() now follows the profile's firmwarePortGmMode, so Synth::has_gm_mode() is true on the SC-88 and --reset gm enters GM there instead of falling back to GS. With both modes reachable by SysEx, the lock has to hold on the XP path too: locked in GS a GM System On does a GS Reset, locked in GM Rx.Bank Select and Rx.NRPN are turned off again after every message. Provenance: P-xxxx. Assisted-by: Claude:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addresses the GM-only part of #18.
--reset gsor--reset gmonemuscdandemusc-winmidikeeps every device in that mode for as long as the daemon runs, whatever SysEx it is sent, and across device switches. A device without the requested mode is kept in the other one. Without--reset, behaviour is unchanged: devices start in GS and the MIDI stream may switch them.Each device load prints a notice:
--reset gs--reset gmFor example:
emuscd: no GM mode available on sc55, so GS was selected as the default; it stays in GS mode while emuscd runs, whatever SysEx it is sentLibrary
Synth::has_gs_mode()/has_gm_mode()answer from the device profiles, so the daemons never name a device:gsScaleTuningOnly, or the XP profile's SysEx model ID being GS's42H.Settings::set_gm_mode()already checked, or the XP device having a GM System On.Synth::set_mode_lock(None|GS|GM):--reset gmthe SC-88 is reported as having none.Verified locally
Mode-lock test: new
synth_mode_lock_test(skips without ROMs, like the other ROM tests), run with real ROMs for all five devices, natively and as the 32-bit MinGW.exeunder Wine.has_gs_mode()andhas_gm_mode()match the table above on all five devices.End to end:
emuscddriven over ALSA by two songs. One sends a GS Reset plus a Rx.BankSelect-on DT1, the other a GM System On. Both then send CC0 8 + PC 80 (bank 0 Square Wave, bank 8 Sine Wave). The audio was captured through ALSA'sfilePCM and classified by 3rd-harmonic energy:--reset--reset--reset gs--reset gm--reset gm, thensc55, thensc55mkiion stdinNotices: the notice is right for all 5 devices ×
gs/gm/none onemuscd, and for the JV-880 and JV-1080 in both modes onemusc-winmidiunder Wine.--reset xgis rejected with exit 1.emusc-winmidi.exestill imports only KERNEL32, msvcrt and WINMM.Unrelated, pre-existing: with the SC-88 ROMs present,
synth_reset_test's SC-88 case fails onorigin/mainas well (restored > silenced * 100.0). CI runs without ROMs, so it is skipped there. This PR does not change it.SC-88 GM mode (a740e6c, 7788745)
The SC-88 now has a real GM mode, so
--reset gmenters GM on it instead of falling back to GS.7E 7F 09 01, device ID 7F only) runs the GS Reset's module reset. It then turns Rx.Bank Select off (part +18 bit 0) where GS Reset turns Rx.NRPN on (+2 bit 15).40 1x 23/24/0a.XpDeviceProfile::firmwarePortGmMode, says which devices have the mode, anddevice_has_gm_mode()reads it.synth_mode_lock_testgains an SC-88 case, and there is a newemuscd/tests/power_on_test. With the SC-88 and JV-1080 ROMs supplied, ctest runs 33 tests: 30 pass, 2 skip, and only the pre-existingsynth_reset_testfailure remains. JV-1080 and GP-engine output is byte-identical.🤖 Generated with Claude Code