-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add Capital Tone Fallback support for faithful early GS standard emulation #2390
Comments
List of affected games from this post: Comprehensive list of games with various CTF issuesThese will only play correctly on an original SC-55 with CTF support.
Games that use CTF for invalid variation tone bank change messagesThese will only play correctly on an original SC-55 with CTF support.
Games that use variation tonesJust for completion's sake, here are a handful of games that use actual variation tones in their soundtracks (non-exhaustive list):
Games that send invalid drum kit program change messages within 65-127 (ROM v1.xx) or 58-127 (ROM v2.xx) rangeThis is only tangentially related to the proposed CTF feature, but decided to include it for completeness (and it's useful info, regardless).
|
Concrete example why this can matter a lot in actual practice and it's not just some cork-sniffer "authenticity" thing (that I'm prone of when it comes to audio, I'm the first to admit! 😅) [related terms, if you're wondering: "gear snob" (self-explanatory), or "pixel peeper" in digital photography circles...] MT-32 support seems to be buggy in some later entries of the iconic Might & Magic RPG series (it causes random crashes on real hardware too). It appears that using the General MIDI driver is the only viable option, but that is plagued by the CTF issue (musical notes will be played instead of sound effects, which can be pretty annoying). Affected games:
Further details: https://www.gog.com/forum/might_and_magic_series/world_of_xeen_sound_effects_issues/post3 |
Wow, first time hearing about this, but the list of affected games is quite impressive :(
That's a name I haven't seen in a looong time, lol ;) Is this something we can implement on top of FluidSynth API? I'm not sure, but I assume it will be mostly filtering MIDI stream before forwarding commands to FluidSynth... If I understand correctly, mapping file ( |
Sound effects on Xeen games are confirmed to work at least on 4GMGSMT 📁 . (edit: ref added) |
It has nothing to do with FluidSynth, specifically. Nor is the feature meant for FluidSynth only. EDIT: Missed your comment before I wrote the long-winded explanation ("I'm not sure, but I assume it will be mostly filtering MIDI stream before forwarding commands to FluidSynth..."). Yes, you're right, it's a MIDI level feature. Reading comprehension skill check failed on my part 😢 As I mentioned, you need CTF emulation when using external hardware devices too, e.g. all SC-55 mk2 modules and SC-55 devices with later ROM versions (1.20+ if I'm correct). Or if using FluidSynth as an external process. For example: I have a first revision SC-55 with the latest ROM revision (v1.21). That's the best old ROM revision, actually (most bug-free), This needs to be implemented as a MIDI stream processor, just like I'm sanitising the MIDI stream to make it standard-compliant (see original PR here: #2308), plus how I've added proper MIDI mute/unmute pause/unpause support (#2318): https://github.com/dosbox-staging/dosbox-staging/blob/main/src/midi/midi.cpp#L444-L492 So, this is a MIDI level feature; FluidSynth users will of course benefit from it too. With this feature added, I will implement a proper MIDI stream processor as I mentioned here as the current solution is messy but I wasn't in the mood for a rewrite (e.g. the processor takes a stream of input MIDI events, it has a "process" function that does the mapping/processing/altering/filtering of events, then it outputs the resulting MIDI event stream).
I think it will be device-specific. Ideally, it won't need to know anything about SoundFonts, and the best solution would be if a single hardcoded mapping would suffice (I think that's how BASSMIDI does it, so the whole |
That's all good and well, and maybe that particular SoundFont implements the fallback somehow. Even if that can be done, every single SoundFont would need to implement this same thing over and over in a bug-free manner. But this is about implementing it as a general feature, and users of hardware modules most definitely need it too, as I explained. |
I've looked into it some more @dreamer and actually yes, for SoundFonts I'm pretty sure we can query the preset list of the given SF2 file to check whether a given variation tone is implemented. In theory, the preset and bank number are all we need, but the devil is always in the details 😄 The |
Oh, I almost forgot about that - just leaving a comment to spread the knowledge in case it pops up. This |
Because I didn't read the old SC-55 manual until recently and "Capital Tone Fallback" is usually how this is referred to, I feel I should mention Roland actually did "Sub Capital" fallback too, in that early SC-55. It's mentioned on page 43 of the original SC-55 manual. Since that discovery, I remapped the fallback files I'd been offering for my patched QMIDIRoute, which can be used to similar effect. My maps are in the form of ".qmr" text files. Although post SC-55mkII GS sound modules would have different fallback, no games were made reliant on newer modules' fallback, as it would have been noticed by developers, since it simply wouldn't have worked, due to Yamaha's patent. Because of that, and the time in which they were created, as far as DOS games go, you shouldn't need multiple fallback profiles based on the more modern GS synth you're using, (except for one instance) as the differences all fall between the releases of the original SC-55 with its fallback, and the SC-55mkII without it. That one instance is because Roland moved Fl.KeyClick to variation 1, from the variation 0 (capital tone) it had occupied, between the original and SC-55mkII, and different games seem to want either Fl.KeyClick or BreathNoise on program 122 (or 121 from 0). Roland moved it, as having BreathNoise there, is one of the requirements for GM support. Descent's Game14.mid file (floating around online) seems to expect Fl.KeyClick on channel 9 (while not setting any variation, so it selects the capital tone, BreathNoise on the SC-55mkII and newer) in the first part of the song. Descent II's Game03.mid file likewise sets it on channel 11. Fl.KeyClick there is a bit obnoxious, but could be right, as BreathNoise is so quiet. Descent is from 1995, and Descent II from 1996, so if the composers used up-to-date contemporary modules, neither should have Fl.KeyClick. This thread is a fun read on the matter: https://www.vogons.org/viewtopic.php?f=7&t=36087 My QMIDIRoute patch has been difficult to find, of late. You can find the original, unmodified, Debian source here, if you're not using Debian yourself: https://drive.google.com/file/d/1EOo-llOW5XXvkiy_3EvOAuUuU4Fn6B4B/view?usp=share_link And, while the site I'd been posting releases to, has been poorly maintained and has been down for the last month or so, due to my diligence with archive.org the latest patch (0.5.3, despite my typo) and build instructions can still be found here: https://web.archive.org/web/20220929045314/https://www.midimusicadventures.com/phpbb/viewtopic.php?f=4&t=17790&start=20#p18702 |
Thanks for the extra info @jaffa225 and for attaching your code; I'll have a detailed look at these when I start implementing the feature! Good stuff! |
You're quite welcome. You probably won't want to base your code on my patch, as it's pretty messy and more of a hack (although it works well), but I expect the ".qmr" fallback maps could be fairly easily parsed into something usable. |
So, is this what all those pesky mids playing piano like percussion, have been? |
Yeah, that's it. |
More info on Sub Capital Fallback: |
Overview
Capital Tone Fallback (CTF) is an interesting feature exclusive to early GS standard capable General MIDI modules. Later modules, including Roland's own later SC-55 firmwares, completely dropped support for CTF, making games that rely on CTF use either the wrong sounds, or not play any sounds for certain instruments.
In a nutshell, the GS standard supported by the SC-55 and compatible modules such as the Yamaha MU80 extends the standard 128-instrument General MIDI sound set with so-called Variation Tones. Conversely, the 128 standard instruments are called Capital Tones. CTF means that if a module does not support a given Variation Tone, it would fall back to playing its Capital Tone instead.
CTF only seems to be supported in the earlier SC-55 mk1 modules up to v1.21. The feature was dropped in SC-55 v2.00, SC-55 mk2, and later Sound Canvas modules due to Yamaha suing Roland over this (apparently, CTF was essentially a Yahama invention that predates the Sound Canvas).
Currently, FluidSynth does not support this feature (understandably, as emulating the SC-55 is out-of-scope for them), neither Roland's own official Sound Canvas emulation product, the Sound Canvas VA, which emulates the much later SC-8820 from 1999. People using actual hardware SC-55 modules with later ROM revisions are missing out on Capital Tone Fallback as well.
At present, the only two solutions are either using BASSMIDI with emulation which implements CTF, or routing the MIDI stream through the Falcosoft MIDI Player that also has support for CTF, then either using an external FluidSynth player, SCVA in a VST host, or external MIDI modules. That works, but it's cumbersome.
To make life easier, we should implement the CTF mechanism in DOSBox itself. It's just a matter of intercepting program change messages in the MIDI handler and doing some mapping, accordingly.
Implementation
The Falcosoft MIDI Player provides generic mechanism for CTF in the form of insrument mapping files. As there's zero point in reinventing a wheel (that is already round and usable 😄), the plan is to add support for this mapping format (text files with
.ins
extension). These can go into our resources folder and can be included with DOSBox out-of-the-box.Details will be fleshed out during the actual work, but the mapping needs to be selectable, e.g.
References
Falcosoft MIDI Player - How to use Capital Tone Fallback emulation?
https://falcosoft.hu/midiplayer_howto.html#a16
The CTF mechanism is well-defined and documented in the original user manuals (from this post):
Also described on Nerdly Pleasures in great detail:
https://nerdlypleasures.blogspot.com/2013/06/first-generation-roland-gs-devices.html
More info on Vogons (warning, information overload!)
https://www.vogons.org/viewtopic.php?f=46&t=46111&start=240#p502660
https://www.vogons.org/viewtopic.php?f=5&t=48207
SC-55 ROM version differences
https://www.vogons.org/viewtopic.php?f=62&t=59497
The text was updated successfully, but these errors were encountered: