Community

SCI Programming => SCI Development Tools => Topic started by: gumby on May 28, 2012, 09:53:35 AM

Title: Using Soundbox
Post by: gumby on May 28, 2012, 09:53:35 AM
How do I use this?  I've imported a midi file & it appears that the only channel that it plays on is 80 New GM (I select different filters at the top, but all the rest of the outputs are silent).

My question is how to enable the other outputs?  I'm thinking it might be under the 'Channel Properties' option, but when I attempt to select this, Soundbox crashes with a 'TODO' message.  I'm running Win 7, 64 bit.

EDIT: Never mind, I downloaded the statically linked copy (see here: http://sciprogramming.com/community/index.php/topic,2.0.html), and now I can select the channels.
Title: Re: Using Soundbox
Post by: gumby on May 28, 2012, 10:58:45 AM
I think I need a little guidance here.  I want to use digital sounds in my game which limits me to the SNDBLAST or the MTBLAST.  Not everyone has an MT32, so I think I'm going with the SNDBLAST driver.

Digital sound effect are no problem.  But for music when I'm trying to take a midi & get it to play out on the Adlib, the instruments are all switched around - and I get that there is not a one-to-one mapping of instruments.  Basically, the result is fairly crappy.

My question:  Is there a recommended technique for making the AdLib play as close to the midi sound as possible?  Which apps should I be using?  Are there recommended instruments to use (especially as a replacement for a drum track)? At this point, I've messed with Anvil a bit to switch the instruments, but to hear the result I throw it into a game & crank it up.  It's very trial and error.
Title: Re: Using Soundbox
Post by: Collector on May 28, 2012, 03:04:10 PM
Isn't this what the PATCH resources are for?
Title: Re: Using Soundbox
Post by: MusicallyInspired on June 05, 2012, 01:05:55 AM
What there needs to be is a General MIDI compatible Adlib PATCH resource. That is to say, a PATCH resource with an instrument mapping order like that of the General MIDI standard. This would need to be arranged and created, however. There's also a limitation because the General MIDI standard has 128 instruments, while the MT-32 and Adlib PATCH resources are limited to a smaller number. So any GM MIDI file converted to a sound resource would have to use the patch instruments up to that number and not over.

KQ6 has GM PATCH resources, at least for MT-32 so it's likely that the Adlib one is GM as well. The problem is that it's SCI1.1 formatted and not SCI0. Generating one from scratch is certainly possible with the current tools available, it would just take a while. I can't believe I never thought of this idea before, though. Perhaps I can find time in the future sometime to put that together. But it's certainly possible.
Title: Re: Using Soundbox
Post by: Collector on June 05, 2012, 03:04:06 PM
That would be great.
Title: Re: Using Soundbox
Post by: gumby on July 01, 2012, 05:02:30 PM
Done (and attached here)!

I found a huge AdLib bank file (over 1000 instruments) in an application called AdTrack2.  I extracted all the instruments using SBANK, then I dug through all the instruments, matching the files up to the General MIDI specs.  I renamed the instruments so they were in the correct alphanumeric order in the directory, then ran SBANK again creating a new BNK file with the 96 instrument files.  Ran that through BNK2PAT, and now we've got a GM compliant AdLib patch file.

I was able match up about 95% of the instruments for sure, and had to use 'generic' instruments when there wasn't a perfect match (when I couldn't find a specifically named guitar file for example, I just went with one of the guitar files that were available).  I've included the INS files if anyone wants to tweak it further.  

This basically means that we can grab most any MIDI file (make sure it's 'Format 0' - you can convert it in Anvil if it's not) and convert it to a SOUND file (with MID2SND) and it'll sound pretty darn good with the SNDBLAST driver.

I've tested it with a few midi's and the output it generates is really quite acceptable.  Just take the patch file and drop it in the base directory of your game (or you can import it into RESOURCE.001 if you want) and modify your RESOURCE.CFG file to use SNDBLAST.DRV for the sound driver.
Title: Re: Using Soundbox
Post by: gumby on July 02, 2012, 10:35:54 PM
I've attached a midi sound pack which utilizes the adlib patch file.  Contains 21 different music tracks.  Note that the sound files will also work with the MPUMIDI driver (and possibly others) as well.
Title: Re: Using Soundbox
Post by: MusicallyInspired on July 03, 2012, 08:11:53 AM
Fantastic!! Can I have a link to this Adlib bank with over 1000 instruments possibly?

We just need an MT-32 patch resource with GM-compliant instruments and we're good to go.
Title: Re: Using Soundbox
Post by: gumby on July 03, 2012, 08:32:58 PM
The application I found the bank file in is AdLib Tracker 2.  Here's the link:

http://code.google.com/p/at2/
Title: Re: Using Soundbox
Post by: gumby on July 03, 2012, 11:44:19 PM
So, I've starting working with the Soundbox & the MTBLAST driver.  I can effectively modify the MT32 playback within Soundbox by selecting a different PATCH.001 file immediately before playback begins.

Here's the interesting part:  the MTBLAST driver doesn't seem to be affected by PATCH resources.  If I try to reproduce my same test in a game & use the MTBLAST driver, I seem to get the same set of instruments every time, regardless of the PATCH file I'm using.  Does this driver use some sort of 'adaptive' instrument selection based on the midi data, similar to the MPUMIDI driver?

When I export the embedded MT32 patch resource from the template game in (RESOURCE.001) & use that for playback in Soundbox, it's definitely not the same set of instruments that I get in-game when I play without a PATCH file at all - which seems to indicate even more that the MTBLAST driver isn't sensitive to patch resources.

Maybe because I'm using MUNT?
Title: Re: Using Soundbox
Post by: MusicallyInspired on July 04, 2012, 08:21:06 AM
Remember that the MT-32 driver uses a different PATCH file than Adlib, which must be PATCH.001 instead of PATCH.003 for Adlib. It works for me on every game I've made.

If you're trying to create a General MIDI compliant MT-32 Patch, it might be easier to grab KQ6's SYX from Quest Studios and convert it to a SCI0 PATCH instead with SYX2PAT, since KQ6's MT-32 support is General MIDI anyway.
Title: Re: Using Soundbox
Post by: gumby on July 04, 2012, 10:57:03 AM
Yes, I'm using the correct patch number, but I just seem to get no variation on the MT32 playback in-game that I can discern, at least nothing like the difference when using Soundbox.

So does this mean that there isn't any instrument arranging to do if we go with the KQ6 sysex?  Just a simple conversion using SYX2PAT?  Or do we still need to extract the individual instruments and build a new sysex file with the instruments in GM order and then run it through SYX2PAT?
Title: Re: Using Soundbox
Post by: MusicallyInspired on July 04, 2012, 06:17:16 PM
No, KQ6's patch is General MIDI compliant out of the box. Tom has already converted it to SYX format on Quest Studios.

I'm not sure why your tests aren't working in-game. I wouldn't know where to begin. Can you send me your files for me to test?
Title: Re: Using Soundbox
Post by: gumby on July 04, 2012, 08:58:47 PM
Sure, I'd love another pair of eyes on this.  I've included two patch files, KQ1 and KQ6 along with a SOUND.000 that couldn't sound more different when played with the different patches within Soundbox.

The resource.cfg file is referencing the MTBLAST driver, and the game is just a template game that cranks up SOUND.000 upon start.

The only thing you should have to do is rename whichever patch file you are testing to PATCH.001 & start up the game.
Title: Re: Using Soundbox
Post by: gumby on July 06, 2012, 09:12:01 PM
I guess I can go ahead and post the MT32 GM patch here.  My system problems don't need to hold that up.

So, we now have out-of-the-box support for General Midi files converted to SOUND resources for the MPUMIDI, SNDBLAST and MTBLAST drivers & probably the standard ADL & MT32 driver too, just haven't tested them yet.
Title: Re: Using Soundbox
Post by: MusicallyInspired on July 11, 2012, 06:32:16 PM
Ugh, sorry man. I completely forgot about this. RL and all. I'll take a look now.
Title: Re: Using Soundbox
Post by: MusicallyInspired on July 11, 2012, 06:39:54 PM
I just tried your game and the different patch files work for me.  ???

I first tried it out of the box (with the patch.001 file included in the resource.001 file) and I heard trumpets and a sax (I think) playing. I then tried KQ1's PATCH file and I heard bird tweets. I then tried KQ6's and I heard piano and/or harp. Mind you, I did not include these into the game's resource.001 file, but left them in the root game directory.

Quick question, you weren't adding them into resource.001 and forgetting about a PATCH.001 in the game directory were you? This would override anything you put in the resource file, obviously.
Title: Re: Using Soundbox
Post by: gumby on July 11, 2012, 08:31:07 PM
I tried multiple configs, even with creating a new game just to make sure.  I also tried deleting the patches from the resource.001 files to confirm that the patches were being used.  My system just must be misconfigured somehow, which is fine now that I know. 

Your report of the sounds was consistent with what I heard when I played the tracks in Soundbox, so that's good.

Thanks for testing it out.
Title: Re: Using Soundbox
Post by: Collector on July 12, 2012, 12:41:36 AM
If a PAT file from KQ6 works in an SCI0 game, I guess that there was not much of a change in the format of PATCH/PAT from SCI0 to SCI1.
Title: Re: Using Soundbox
Post by: MusicallyInspired on July 12, 2012, 01:48:28 AM
No, SCI1+ patches still don't work with SCI0. Tom has a bunch of raw captured MT-32 SYX files of pretty much all SCI games. These can be converted to SCI0's PATCH format with SYX2PAT.
Title: Re: Using Soundbox
Post by: Collector on July 12, 2012, 04:08:18 AM
Ah, I guess that I didn't catch that they weren't directly imported.