-
Notifications
You must be signed in to change notification settings - Fork 43
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
Improve looping for older midi hardware devices #2180
Conversation
When the song loops, only reset the used channels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Glad to see you back.
Looks good, thank you! I can't replicate it on the Nuked SC-55 either. Maybe it depends on the emulated model? |
kraflab/dsda-doom#600 (comment) I recorded audio from Nuked SC55 (mk2) with the test wad. You can easily hear that in DSDA-Doom the music loop is not played correctly... every time the track starts again, the initial notes are played too fast. |
Regarding it stuttering or not in Nuked vs real hardware. When connected via USB or serial port, the overload sound like a stutter (the first note arrives late and runs into the next one). With vanilla Doom tracks, besides E2M1 there's also D_INTRO that overloads the device right away. My understanding is that even without GS Reset, just the program and control changes for 16 tracks are more than enough to overload it. A possible, more robust way of ensuring seamless playback would be getting all events before the first Note On, and playing them in advance and staggered if possible - after the channel's last Note Off but before the track actually loops. |
It's the composer's responsibility to space out midi events appropriately (a lot of older midis do this) and to test their midis with their target midi devices. Woof's responsibility is to just play the events as written. Creating workarounds for older hardware eventually introduces other issues. There are wads that have midis with hundreds of events bunched together at the immediate start. Spacing these out as a fix would create a noticeable delay. That's just one example. Using retro midi hardware or accurate emulators (Nuked SC-55) will always have compromises. Enjoy them with the selection of (older) wads that work okay, otherwise understand that most midis are only tested with software now, usually the default Windows synth or a soundfont player. |
Apparently modern Doom midis are composed with the Windows midi synthesizer or this soundfont: https://musical-artifacts.com/artifacts/724 (including tracks from the new Legacy of the Rust expansion). Both have the Roland Sound Canvas sound. Another solution is to find a copy of Edirol Virtual Sound Canvas and use the VSTi plugin with Falcosoft Midi Player (same sound as the Windows synthesizer but with working reverb and chorus, and 128 voice polyphony instead of 32). The above solutions however don't have a high quality sound. |
This was reported on the speedrunner Discord. Apparently there's stuttering with vanilla songs (E2M1) when using Nuked SC-55 (I couldn't reproduce it). However, I verified there was stuttering with a real SC-55. Test wad: shortloop.zip
When a midi song finishes playing, the DMX system in vanilla Doom sends "reset controllers" and "default volume" events, but just for the channels that are used by the current song. Then it loops from the beginning. Woof and DSDA-Doom (and maybe others) send the same events but to every channel. It seems these extra events are enough to overload older midi hardware. It's more noticeable with songs that place too many events together at the very start of a song (E2M1). The fix is to just mimic what vanilla Doom does.