Page 1 of 2

Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Tue Nov 28, 2017 9:33 pm
by Barrels
Since the removal of the FMod option in 2.1, Some midis refuse to play under the GM Wavetable.

Another Problem which emerged sometime between 2.1 and 3.2 is that OPL3 emulation became faulty when playing .IMF or .RAW files, causes stutters at random intervals.

I have provided a video with timestamps of the music played or attempted to be played on 2.0.05, 2.1 (Only MIDI) and 3.2
[youtube]https://www.youtube.com/watch?v=vmKKSshFAwU[/youtube]

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Nov 29, 2017 1:29 am
by Graf Zahl
The MIDI playback issues are outside GZDoom's control. The Windows synth just won't play them. Switch to another one, support for this is essentially deprecated because the system's implementation is broken beyond repair and Microsoft has shown no signs to fix this for over 10 years.

The OPL playback will require some investigation by someone with actual interest in that code and better knowledge of OPL in general. The OPL synth had to have some code replaced for licensing issues which I suspect to be at fault here.

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Nov 29, 2017 1:43 am
by Barrels
Well that's a shame about the MIDIs. Is there a possibility of getting OpenAL to play midis like FMod did? Even when FMod was in place and GM Synth worked, if I were to play those two midis I demonstrated through it, the synth of Windows 7+ would just cut some of the notes off because there's too many voices; FMod as well as XP's Synth didn't cut those notes off.

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Nov 29, 2017 8:33 am
by Graf Zahl
OpenAL has no native MIDI playback. You will have to choose one of the other synths.
And yes, the Win 7 synth is broken. But it's outside of out control.

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Nov 29, 2017 12:39 pm
by Barrels
Well that's too bad... While on the topic of OPL, you could possibly use AdPlug's Library for OPL playback, as it's free and offered on github. Its last update was less than a couple of weeks ago.

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Nov 29, 2017 4:32 pm
by Chris
If OpenAL offered native MIDI playback, it would essentially be yet another softsynth (though given the choices between FluidSynth and Timidity, that may not be a horrible idea if the rendering quality is up to snuff).
Phoebe Tootfield wrote:Well that's too bad... While on the topic of OPL, you could possibly use AdPlug's Library for OPL playback, as it's free and offered on github.
From my reading of their readme, it seems like AdPlug uses DOSBox's OPL synth which GZDoom already includes. Does it add much on top of it?

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Nov 29, 2017 9:10 pm
by Barrels
AdPlug does add something by offering playback of a greater variety of file types than just .IMF and .RAW, such as an Adlib Tracker 2 or a LOUDNESS Sound System (Tyrian) file. AdPlug also supports separate .BNK and .REF files for each track, although I'm not sure if GZD already supported that with IMF files, or plain MIDI if played through OPL Synth.

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Thu Nov 30, 2017 1:30 am
by Graf Zahl
It also does not mix well with ZDoom's MIDI player.

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Dec 13, 2017 2:05 pm
by Guest
Apparently, either certain or all SysEx events prevent midis from playing on ZDoom through the GS Wavetable, and deleting said events from the songs allow them to play. That doesn't stop the Wavetable from turning the songs into trash though...

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Tue Dec 19, 2017 8:20 am
by Jimmy
Ursula Lightdale wrote:Apparently, either certain or all SysEx events prevent midis from playing on ZDoom through the GS Wavetable, and deleting said events from the songs allow them to play. That doesn't stop the Wavetable from turning the songs into trash though...
I have found this to be true. Take this MIDI from Duke3D (SPOOK.MID) which refuses to play in GZDoom with the MIDI device set to GS Wavetable (it seems to do fine in other devices, mind).
https://www.dropbox.com/s/ywzn9u5kkfpn1 ... K.MID?dl=1

Here is a fixed version of that same MIDI. I removed the SysEx messages from it and found that it played on the GS Wavetable device.
https://www.dropbox.com/s/a6uct6idqtb1k ... x.MID?dl=1

You do have to be careful with this though, and ensure to relisten to the MIDI after deleting the messages. I found with this MIDI that I had to enter the Event List window of my MIDI program to delete one of its two SysEx events from there first, and then delete the remaining one in the program's SysEx window. Apparently the timing of certain instruments is dependent on these messages, hence how I ended up with this botched version of the MIDI:
https://www.dropbox.com/s/40noi2s4kv492 ... d.MID?dl=1

...where the lead melody enters one quaver before it should and is off-rhythm for the entire piece. This resulted from me deleting the two messages from the SysEx window before doing so from the Event List window. I'll have to experiment some more.

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Tue Dec 19, 2017 7:29 pm
by wrkq
Forgive me for pulling this totally off topic, but are those screenshots from Voyetra Orchestrator for Win 3.x?

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Dec 20, 2017 12:58 am
by Jimmy
Cakewalk Express, but yeah, for Win 3.x.

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Dec 20, 2017 3:59 am
by _mental_
I didn't get how is a bug in GS Wavetable related to removal of FMOD? Sound backend isn't used for music playback in this case.
GZDoom 3.2.4 doesn't play some MIDIs in exactly the same way ZDoom 2.8.1 (or any other version) doesn't play them.

As for the second bug report, please provide file(s) to work with.
I would like to have the exact steps to reproduce in order to replicate and fix the problem.

BTW reporting more than one issue in the same topic is always bad idea.

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Dec 20, 2017 11:39 am
by Chris
_mental_ wrote:I didn't get how is a bug in GS Wavetable related to removal of FMOD?
FMOD has a MIDI softsynth. When FMOD was removed, GZDoom then defaulted to Windows' MIDI device, which is typically the GS Wavetable synth.

Re: Absent MIDIs, Stuttering OPL3 (.RAW/.IMF)

Posted: Wed Dec 20, 2017 2:21 pm
by _mental_
I forgot that there was a release with FMOD removed but without FluidSynth as the default MIDI player.
Switching to it manually is a really good idea in this case.