VOGONS


First post, by MusicallyInspired

User metadata
Rank Oldbie
Rank
Oldbie

Update (05/03/2023): SCI2FB v1.01 update! It now supports older patch files that have only one sysex bank:
-KQ4
-PQ2/LSL2 (they're identical, much like SQ3 and KQ1SCI)
-LSL2old (LSL2 has an older FB-01/IMF patch file with very different instruments)
-Silpheed (the only non-SCI game with an SCI-formatted patch file)

SCI2FB performs the reverse process to that of FB2SCI! (convert SCI FB-01 patch file into 1 or 2 FB-01 sysex bank files depending on how many are in the patch)
https://github.com/MusicallyInspired/SCI2FB

===============
Original post:

I'm currently composing music for Ryan Slattery's Betrayed Alliance Book 2 SCI0 adventure game (there's a recently released demo available for download). I'm aiming to compose for as many of the original music devices that SCI0 originally supported as possible. So far I successfully worked in support for MT-32, Adlib, PC Speaker, Tandy, and now the Yamaha FB-01. (next on the list is the CMS/Game Blaster)

I worked out (with a lot of research and a lot of help) the format of the FB-01's bank sysex files (which aren't raw sysex like other synth dumps are) and wrote a program that converts the data to Sierra's FB-01 Patch format. My program reconstitutes the data from the bank files (two banks of 48 instruments each) back to standard sysex messages and writes them to an output SCI patch file. The SCI patch format is just the two-byte header and the raw sysex dumps of the two 48-instrument bank data separated by ABCDh.

It's probably not efficiently programmed, but it works. I'd like to somehow reverse the process so we can create FB-01 bank sysex files from Sierra FB-01 patches because otherwise you need to get each game to dump their banks to the FB-01 by launching the game first and then capture the dumped banks with software on your PC similar to how we used to get MT-32 patch banks from SCI games, but the process was much simpler as the MT-32 produces standard raw sysex dumps . For the FB-01 it's a more complicated process because the dumps are byte-swapped and split. The format isn't the simplest design ever (at least not for me). There are checksums everywhere and the first two bytes of each instrument packet are byte split in a completely different manner to the actual patch data. It will take me a while to wrap my head around how to code that as I'm not an advanced programmer.

Besides having the ability to now make custom FB-01 compatible soundtracks for SCI fangames and create custom FB-01 patch banks, some official Sierra releases can also be improved. Some of the SCI games that support the FB-01 contain instrument patch maps that don't really correspond well at all to the game. KQ1SCI, for instance, uses the exact same patch bank as SQ3 which makes no sense and many instruments sound terrible. So having the ability to make custom patch banks is a big plus.

https://github.com/MusicallyInspired/FB2SCI
(I called it FB2SCI because I originally attempted this a while back and called it FB2PAT and it failed miserably so I started from scratch but didn't want to delete my first attempt so I named it a new project so as to not conflict)

NOTE: The current public demo release for Betrayed Alliance Book 2 isn't optimized for the FB-01 quite yet. I only just got this working recently just after the demo's release and my bank has some issues that need to be worked out to sound a little better. Once it's finished I'll release the patch file and you can play the demo with an FB-01, the MAME64 FB-01 emulator, or the IMFC.

Attachments

  • Filename
    SCI2FB.zip
    File size
    34.16 KiB
    Downloads
    61 downloads
    File comment
    v1.01 update (now supports one-bank patch files)
    File license
    GPL-2.0-or-later
  • Filename
    FB2SCI.zip
    File size
    30.09 KiB
    Downloads
    65 downloads
    File comment
    (rebuilt after fixing an errorhandling oversight)
    File license
    GPL-2.0-or-later
Last edited by MusicallyInspired on 2023-03-06, 04:46. Edited 10 times in total.

Yamaha FB-01/IMFC SCI tools thread
My Github
Roland SC-55 Music Packs - Duke Nukem 3D, Doom, and more.

Reply 1 of 21, by Scali

User metadata
Rank l33t
Rank
l33t

Ah, this is very interesting!
What is also interesting, is that some Sierra games have broken FB-01/IMFC soundbanks.
That is, there are two ways to send instrument parameters via SysEx. One is to send parameters to a specific instrument, the other is to send parameters to a MIDI channel.
Some Sierra soundbanks mistakenly send the parameters to MIDI channels, assuming the instrument:channel mapping is 1:1, which it isn't. So the instruments are broken.
Perhaps with your tools, they can be fixed to sound the way they were intended.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 3 of 21, by MusicallyInspired

User metadata
Rank Oldbie
Rank
Oldbie
Scali wrote on 2023-02-26, 10:16:
Ah, this is very interesting! What is also interesting, is that some Sierra games have broken FB-01/IMFC soundbanks. That is, th […]
Show full quote

Ah, this is very interesting!
What is also interesting, is that some Sierra games have broken FB-01/IMFC soundbanks.
That is, there are two ways to send instrument parameters via SysEx. One is to send parameters to a specific instrument, the other is to send parameters to a MIDI channel.
Some Sierra soundbanks mistakenly send the parameters to MIDI channels, assuming the instrument:channel mapping is 1:1, which it isn't. So the instruments are broken.
Perhaps with your tools, they can be fixed to sound the way they were intended.

Hmm. Would that be an issue with the patch bank though or the driver? Because the bank sysex files are just patch-mapped instrument definitions. It stores no information for MIDI channels assigned to the 8 instruments or anything like that because that information changes many times throughout a game. Since the FB-01 operates by "sets" of 8 instruments with each instrument assigned to a specific MIDI channel along with number of voice polyphony, LFO settings, panning, volume, transposition, and a couple other settings, and since SCI sound resources can designate any of the 16 MIDI channels to any device separately, it would have to be the SCI driver that changes the "sets" on the fly by reassigning MIDI channels, voice polyphony, etc every time for every instrument when a new Sound resource is played back (or even every time a sound resource changes patch, pan, or volume information in the middle of a song). I don't think making a change to the patch bank would help in this instance. And I'm afraid fixing the driver is beyond my capabilities. 😅

But if the issue is with the incorrect patch being applied to an instrument it could be a result of the sound file itself setting the wrong patch definition/channel or the patch map itself not corresponding with the other music device patch maps (MT-32, Adlib). That could be fixed but it would be at the sound resource level. The KQ1SCI issue is definitely the patch map not corresponding to the MT-32/Adlib patch maps though (seems like an oversight on Sierra's part for supplying the wrong patch map for the game).

Can you list the games that have the issue you mentioned? I'll look into it.

Yamaha FB-01/IMFC SCI tools thread
My Github
Roland SC-55 Music Packs - Duke Nukem 3D, Doom, and more.

Reply 4 of 21, by Scali

User metadata
Rank l33t
Rank
l33t
MusicallyInspired wrote on 2023-02-26, 15:59:

Hmm. Would that be an issue with the patch bank though or the driver?

Ah yes, you may be right. It's the driver that generates the actual SysEx commands sent to the device.
It's been a few years since I played around with it... But yes, I think the issue was specifically with the FB-01 driver.
That is, the IMFC supports a few SysEx commands that the FB-01 does not. So the FB-01 driver does some translations to other SysEx commands, and there was a bug in there.
But there probably isn't a way to solve that in the soundbank itself, so yes, we would need a fixed driver.
Ironically enough, the IMFC support for DOSBox and SoftIMFC assume that you have an FB-01, so it does the same translation, but correctly. Which makes games that break with the FB-01 driver work when you run them with the IMFC driver.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 5 of 21, by MusicallyInspired

User metadata
Rank Oldbie
Rank
Oldbie

Yes that DOSBox build is a godsend. I tried the fixed drivers for the FB01 that I could find but it didn't change anything with the issue. The IMF DOSBox build is the way to go for now.

Yamaha FB-01/IMFC SCI tools thread
My Github
Roland SC-55 Music Packs - Duke Nukem 3D, Doom, and more.

Reply 6 of 21, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie

I'm glad to see you again, Scali. 😀

Regarding the instrument mapping behavior of Sierra's FB-01 driver, ripsaw8080 and I corresponded about this several years ago, and he created a further-modified version of his driver that includes enhanced Instrument/MIDI-channel-reception handling. Give it a try.

Attachments

Reply 7 of 21, by MusicallyInspired

User metadata
Rank Oldbie
Rank
Oldbie

Oh excellent! I will try this out.

EDIT: Unfortunately, it still doesn't work. The FB-01 says there's a dump error and the instruments come out all wrong. IMF build of DOSBox still works fine with no errors and sounds very different (better). Tested on high and low DOSBox cycles and with SQ3 and KQ4.

Yamaha FB-01/IMFC SCI tools thread
My Github
Roland SC-55 Music Packs - Duke Nukem 3D, Doom, and more.

Reply 8 of 21, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie
MusicallyInspired wrote on 2023-02-27, 20:55:

EDIT: Unfortunately, it still doesn't work. The FB-01 says there's a dump error and the instruments come out all wrong. IMF build of DOSBox still works fine with no errors and sounds very different (better). Tested on high and low DOSBox cycles and with SQ3 and KQ4.

The dump error explains why it sounds wrong, but I'm not able to duplicate the broken behavior that you're experiencing, either on real hardware, or with DOSBox (tested with Scali's IMF build). What MIDI interface are you using with DOSBox?

Reply 9 of 21, by MusicallyInspired

User metadata
Rank Oldbie
Rank
Oldbie

Behringer U-Phoria UMC1820.

I should also note that when I said the IMF DOSBox build works, I mean with the IMF.DRV driver.

Yamaha FB-01/IMFC SCI tools thread
My Github
Roland SC-55 Music Packs - Duke Nukem 3D, Doom, and more.

Reply 10 of 21, by Cloudschatze

User metadata
Rank Oldbie
Rank
Oldbie
MusicallyInspired wrote on 2023-02-28, 05:43:

I should also note that when I said the IMF DOSBox build works, I mean with the IMF.DRV driver.

No worries; that's how I'd read it. I'm assuming that you'd tested the modified FB-01 driver with that same version of DOSBox though? It's not necessary for this use-case, but since that was the version mentioned, that's also what I tested with.

In my case, and as concerns the modified FB-01 driver:

Scali's IMFC DOSBox (3000 cycles) -> emulated MPU-401 -> M-Audio MIDISPORT Uno -> FB-01 = No issues
486/66 PC -> Roland MPU-401 (LAPC-I) -> FB-01 = No issues
286/10 PC -> RS-232 MIDI (8250) -> FB-01 = No issues

Reply 11 of 21, by MusicallyInspired

User metadata
Rank Oldbie
Rank
Oldbie

Okay so I retested with Scali's build and also DOSBox-X and it does indeed work fine. So I wonder what's wrong with my vanilla DOSBox?

Yamaha FB-01/IMFC SCI tools thread
My Github
Roland SC-55 Music Packs - Duke Nukem 3D, Doom, and more.

Reply 12 of 21, by Scali

User metadata
Rank l33t
Rank
l33t
MusicallyInspired wrote on 2023-02-28, 14:59:

Okay so I retested with Scali's build and also DOSBox-X and it does indeed work fine. So I wonder what's wrong with my vanilla DOSBox?

I have a theory on that.
IMFC/FB-01 send very large SysEx commands, up to about 6k for a full patch bank.
I recall that DOSBox buffers these SysEx commands and sends them in one go (which is a bad design, and won't work with more advanced IMFC/FB-01 stuff, as they support variable-length SysEx sequences, basically putting the device in a Yamaha-specific mode with extended MIDI commands to play notes, change pitch etc). But the default buffer size was not large enough to hold 6k.
I think in my build, the buffer size was increased, and DOSBox-X may have done the same... where your vanilla DOSBox does not.

So your DOSBox may be an older build, from before this change:
"Increase size of SysEx buffer to support Sierra's Yamaha FB-01 driver."
https://sourceforge.net/p/dosbox/code-0/3963/

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 14 of 21, by carlostex

User metadata
Rank l33t
Rank
l33t
MusicallyInspired wrote on 2023-02-25, 22:24:

Besides having the ability to now make custom FB-01 compatible soundtracks for SCI fangames and create custom FB-01 patch banks, some official Sierra releases can also be improved. Some of the SCI games that support the FB-01 contain instrument patch maps that don't really correspond well at all to the game. KQ1SCI, for instance, uses the exact same patch bank as SQ3 which makes no sense and many instruments sound terrible. So having the ability to make custom patch banks is a big plus.

This is absolutely fantastic. By trying several different patch files from different games i managed to find one that sounded great in Space Quest 4:

https://www.youtube.com/watch?v=6jhF-_io8iA

I can now imagine pretty much all SCI 0,1 amd 1.1 games sounding great with IBM MFC/FB01. Just wonderful.
A sort of a VSTi plugin for the FB01 would be awesome too, i could now replace my MIDI modules with Falcosoft and plugins.

Reply 15 of 21, by MusicallyInspired

User metadata
Rank Oldbie
Rank
Oldbie

That does sounds great! With a bit of fiddling and some librarian software you could certainly mix and match and fix up some of the other minor instruments that don't translate as nicely. But that's a solid base. What game is this patch originally from?

I'm pretty much doing the same right now with FalcoSoft plugins to quickly compose without my modules for Betrayed Alliance. There's AMAME's emulator for the FB-01 but you need to use MIDI loopback drivers. I have loopmidi and LoopBe but both have issues with the amount of sysex that needs to be sent so you have to use a real external MIDI cable feeding back into the interface to get it to work properly so may as well just use the actual module (though the emulator sounds better). I'd really welcome a VSTi though.

Yamaha FB-01/IMFC SCI tools thread
My Github
Roland SC-55 Music Packs - Duke Nukem 3D, Doom, and more.

Reply 16 of 21, by carlostex

User metadata
Rank l33t
Rank
l33t
MusicallyInspired wrote on 2023-03-02, 23:06:

That does sounds great! With a bit of fiddling and some librarian software you could certainly mix and match and fix up some of the other minor instruments that don't translate as nicely. But that's a solid base. What game is this patch originally from?

I'll have to check which patch file it is and get back to you. Don't remember exactly which one.

EDIT: Got it, it's the Quest for Glory II patch file.

Reply 17 of 21, by MusicallyInspired

User metadata
Rank Oldbie
Rank
Oldbie

So, interestingly, the SCI1 FB-01 Patch resource has a different header for resource type identifier and also a string for the title of the game starting with "IMF - ". For KQ5 it's 10 extra bytes but for QFG2 it's 25. But otherwise it's the same as the SCI0 format. I'm not sure how the driver determines where the voice data begins unless it uses the ABCDh bytes between the two banks as a reference. I'm also not sure why the string is there at all unless it was just used by the composer to keep track of which banks are which. Because I don't think it displays the title on the unit itself like the MT-32 at any point, does it?

EDIT: Never mind. The size of the title string is indicated in the second byte of the file. For KQ5 the header is 0x89 0x0A. A = 10 being the size of the string. For QFG2 it's 0x89 0x19. 19 = 25. SCI0 patches have 0x89 0x00. Meaning no title. Maybe they could have titles and just don't? I'll have to add an option to set a header string if one wants when creating a patch.

Yamaha FB-01/IMFC SCI tools thread
My Github
Roland SC-55 Music Packs - Duke Nukem 3D, Doom, and more.

Reply 18 of 21, by MusicallyInspired

User metadata
Rank Oldbie
Rank
Oldbie

So I'm wondering how similar the IMF and FB01 drivers are. I know that the only SCI1 games Sierra officially made support for KQ5, QFG2, and Jones and only for the IMF not the FB01. There doesn't appear to have existed any driver for the FB01 for SCI1 at all. Could we create one perhaps by referencing the IMF driver? Obviously the SCI0 and SCI1 drivers are different but I don't know how exactly. The driver structures and function are almost completely foreign to me. I know we have the Scali DOSBox build and SoftIMFC but I'm thinking for original hardware.

Also, it would be fun to add FB01/IMF support for more SCI1 games since the patch format never changed.

Yamaha FB-01/IMFC SCI tools thread
My Github
Roland SC-55 Music Packs - Duke Nukem 3D, Doom, and more.

Reply 19 of 21, by carlostex

User metadata
Rank l33t
Rank
l33t
MusicallyInspired wrote on 2023-03-04, 16:28:

So I'm wondering how similar the IMF and FB01 drivers are. I know that the only SCI1 games Sierra officially made support for KQ5, QFG2, and Jones and only for the IMF not the FB01. There doesn't appear to have existed any driver for the FB01 for SCI1 at all. Could we create one perhaps by referencing the IMF driver? Obviously the SCI0 and SCI1 drivers are different but I don't know how exactly. The driver structures and function are almost completely foreign to me. I know we have the Scali DOSBox build and SoftIMFC but I'm thinking for original hardware.

Also, it would be fun to add FB01/IMF support for more SCI1 games since the patch format never changed.

For the IMF at least, i think its the case of choosing more appropriate instruments for each game which at least sounds simpler, for the FB-01 though creating a new driver does require like you say to properly understand differences between drivers for both devices and also between engine versions for IMF so that a FB-01 could be derived from that. I have no idea how easy would it be, but probably not too complicated.

I also wondered about understanding the Tandy 3 voice driver so that a Sierra Innovation SSI driver could be created. Sierra adventure games on a SID chip would be awesome. BTW, if there's anyone around that understands Sierra drivers is NewRisingSun. Perhaps you should contact him, he could have extremely value info for the work you are doing.