[Fixed] MIDI doesn't send a SysEx reset

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

MIDI doesn't send a SysEx reset

Postby Hellser » Thu Sep 28, 2017 3:40 am

Vanilla Doom used to send a SysEx reset command upon both starting and leaving Doom - so the music will default to standard parameters. I'm using loopMidi for my midi out device (which does support sending and receiving SysEx commands) and routing this into MidiPlayer for my music player. I was getting heavy reverb in E1M1 for an example - come to find out that it's been set to 127. A game I was playing from DosBOX (Stonekeep to be precise) didn't reset the midi device back to default parameters and it carried over into GZDoom.

There's two ways this can be fixed. Revert back to what Vanilla Doom used to do - send a SysEx reset if the user is using a midi device both when starting and quitting GZDoom. Or let the midi song handle the SysEx commands which will allow songs that uses the GS format to use its additional features. (Edit: If a soundfont has compliant GS sounds)

Edit:
These problems become much more apparent when listening to songs in Jimmy's Jukebox. E1M2's song (which pans the drums for the claves) caused E1M3 and all subsequent songs to have its drums panned only to one side. Fluidsynth and all other softsynths doesn't seem to have this problem where as all midi instructions going out to a hardsynth (or in this case, to an external softsynth) are doing it wrong.
User avatar
Hellser
Remember Citadel
Global Moderator
 
Joined: 25 Jun 2006
Location: Citadel Station
Discord: Hellser#8156
Operating System: Windows 11
OS Test Version: Yes (Using Development/Testing Version)
Graphics Processor: ATI/AMD with Vulkan Support

Re: MIDI doesn't send a SysEx reset

Postby Graf Zahl » Tue Feb 27, 2018 7:42 am

Better late than never to respond, but I cannot help you here.

I neither have any hardware I could test such a feature on nor am I comfortable enough in MIDI programming to implement it without some ability to test.
I'm a bit baffled that opening a device doesn't auto-reset it.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: MIDI doesn't send a SysEx reset

Postby XxMiltenXx » Tue Feb 27, 2018 9:26 am

I can confirm this bug. I am using a Roland SC-55, which is connected via a MIDI interface. I am using Coolsoft MIDI Mapper to select the MIDI interface.

If I use Jimmy's Jukebox and play E1M2 and then any other songs, the drums are panned to the right.

However, interestingly enough, neither FluidSynth nor the OPL Synthesizer are afffected by this bug and work properly.
XxMiltenXx
 
Joined: 08 Jan 2014
Location: Germany
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: MIDI doesn't send a SysEx reset

Postby Graf Zahl » Tue Feb 27, 2018 9:49 am

The software synths will be completely deleted and restarted for each song, so obviously they won't be affected. This problem seems to be exclusive to the Windows MIDI API.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: MIDI doesn't send a SysEx reset

Postby Chris » Tue Feb 27, 2018 11:38 am

Basically any persistent MIDI device. Playing a MIDI song modifies the channel properties of the device as it plays, and those changes stay until modified. To the device, there's no separation, it's just a continual stream of events sent from one or more external sources. A MIDI SysEx reset event is a standard event that tells the device to reset everything back to a fresh power-on state, so that the following events work from the standard defaults as if it was just powered on.

As far as the Windows MIDI API goes, when you open the device it just provides a means for the application to send events to the "external" device. I guess it doesn't want to automatically reset it upon opening since it's a separate device with multiple types of uses. In the context of a game it makes sense to reset everything before playback of a song to ensure it plays as intended, but in the context of a composition suite it's probably best to not do more than the composer says to do (they may have previously set things they want kept for the session).
User avatar
Chris
 
Joined: 17 Jul 2003

Re: MIDI doesn't send a SysEx reset

Postby Graf Zahl » Tue Feb 27, 2018 12:05 pm

The MIDI code already sends this when a song starts:

Code: Select allExpand view
      // Send the full master volume SysEx message.
      events[0] = 0;                        // dwDeltaTime
      events[1] = 0;                        // dwStreamID
      events[2] = (MEVENT_LONGMSG << 24) | 8;      // dwEvent
      events[3] = MAKE_ID(0xf0,0x7f,0x7f,0x04);   // dwParms[0]
      events[4] = MAKE_ID(0x01,0x7f,0x7f,0xf7);   // dwParms[1]
      events += 5;


I guess if the reset message is added here it should do the job - so what's the necessary contents?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: MIDI doesn't send a SysEx reset

Postby Gez » Tue Feb 27, 2018 12:32 pm

The GM reset sysex is F0 7E 7F 09 01 F7.
There's also F0 41 10 42 12 40 00 7F 00 41 F7 for GS and F0 43 10 4C 00 00 7E 00 F7 for XG.
Gez
 
 
 
Joined: 06 Jul 2007

Re: MIDI doesn't send a SysEx reset

Postby Graf Zahl » Tue Feb 27, 2018 12:46 pm

Do we need all 3?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: MIDI doesn't send a SysEx reset

Postby Gez » Tue Feb 27, 2018 12:56 pm

I believe only the GM reset is necessary.
Gez
 
 
 
Joined: 06 Jul 2007

Re: MIDI doesn't send a SysEx reset

Postby Graf Zahl » Thu Mar 01, 2018 7:02 am

Ok. I already added it, but forgot this report.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest