Adding Sound Support

From SCI Wiki
Jump to navigationJump to search

Note: various tools for working with sound for SCI games can be found on the SCI Sound Utilities Page


By Brandon Blume


Introduction

What I've learned so far I've seen from opening up sound resources from Sierra games in SoundBox. A proper MIDI file engineered to run through SoundBox to create an SCI0 sound resource will not sound correct when played through a MIDI player because there are multiple copies of instruments on different channels to playback through the different sound drivers (ADL.DRV, STD.DRV, MT32.DRV, etc). Here are some guidelines I've learned.


Classic Adlib/MT-32/PC Speaker/Tandy 3-voice Support

You can use the ADDWave.EXE program included in Ravi's Sound Utilities to append a digital sound file to a sound resource with this method and if you're using SNDBLAST.DRV or MTBLAST.DRV you will hear it in-game instead of the MIDI sound.

  • You can use one channel for multiple outputs (MT-32, Adlib, Tandy, etc) as long as that channel follows the rules for each output.
  • You can use any channel for any output except the MT-32, which can only be on channels 2-9 (9 being the drum channel I think).
  • The PC Speaker channel can be any channel (usually channel 1) but cannot have more than one note playing at a time.
  • The PC Speaker channel should carry the fundamental of the theme of the sound file. The lead instrument, if you will. Because the PC Speaker driver is only one channel anyway, it should contain everything that makes the theme recognizable. You can make this an alternate channel (not the same channel as an Adlib or MT-32 channel) and rework it so it efficiently contains both lead and melody elements. Think how SCUMM games sound in PC Speaker where there's never more than 1 note playing at a time but you can hear lead and melodic elements playing quickly taking turns, if that makes sense.
  • The PC Speaker channel is also one of the three Tandy 3-voice channels, to save on file size. The other two being whatever other channels you want, but they can each only have 1 note playing at a time.
  • I'm not sure if there is a limit to how many Adlib channels you can have, but most Sierra sound resources only have 5. These are also Yamaha and Casio channels usually. I don't have either the Yamaha or Casio hardware to hear what it would actually sound like, though.
  • Most of the time the Adlib channels are the same as the MT-32 channels with a few exceptions, one being if an MT-32 channel has too many voices playing at once requiring a new alternate channel composed slightly differently to meet the requirements of the Adlib polyphony voice count.
  • Adlib does not have a drum channel because of the way it processes its instruments. So channel 10, while usually being the standard drum channel of almost any MIDI device, is a melodic channel and not actually a drum channel in an SCI0 sound resource.
  • An Adlib channel cannot be on channel 9 for the above reason because channel 9 is the MT-32's drum channel.
  • The Initial Voices field in SoundBox in Channel Properties is meant only for Adlib channels. It doesn't affect PC Speaker, Tandy, or MT-32 output at all.
  • As a whole, a sound resource cannot have more than 7 or 8 Adlib voices at a time (I can't remember exactly which, 8 makes more sense, though, but you can experiment). So you have to compose your Adlib channels in such a way that there are never more than 8 notes playing at any one time across all Adlib channels. And an Adlib channel will never play more voices than the number specified in the Initial Voices field of that channel. So you can have one Adlib channel with 8 Initial Voices or 5 Adlib channels with an Initial Voices sum of 8.
  • The above Adlib rules only apply to the ADL.DRV which is a mono Adlib driver. If you use the SCI0 SNDBLAST.DRV instead you have a much higher polyphony limit which is unaffected by the Initial Voices field, and it's also in stereo.
  • I'm not sure how vital this is, but channel 10 (channel 9 in SoundBox) always has an Initial Voices setting of 128. I'm not sure why but I've kept it this way in all my sound resources just in case it's important.

Adlib/MT-32/PC Speaker/Tandy Notes

All the channels I've listed here are the proper MIDI channel designations (1-16). SoundBox numbers them from 0-15 instead, so just be aware of that when you're creating your MIDI file and running it through SoundBox.

 


Standard General MIDI Support

This is the MIDI support in Jummybummy. NOTE: You cannot have digital sound effects with this method

You can completely ignore the huge guidelines list above if you go this method. It's actually very very simple. If you just want to run a General MIDI file through SoundBox you can do that instead and have it support just General MIDI rather than PC Speaker, Adlib, Tandy, MT-32, etc.

Standard General MIDI Notes

You just need to make sure that however you play the game you're going to have a General MIDI device to hear anything. So that's probably not going to work with Command Prompt in Win2k, XP, Vista, or 7. If you're using DOSBox you'd have to set up your DOSBox settings to point to your Windows MIDI Mapper. Your sound resource won't be compatible with Adlib, MT-32, PC Speaker, etc if you choose this method.


Adding the Music/SoundFX Resource

Note: this part is a stub. If you can help, please expand it.
 

To insert/import a sound resource into a game and utilize it after creating it and after you have your midi and ran it through Soundbox, you should have a SOUND.000 file. Using either Studio or Companion use the "Add resource" and select the new resource. Save the resource as whatever number you want. Use it in your game with gTheMusic, gTheSoundFX, or a sound instance of your own creation.

Code:
(send gTheSoundFX:number(XXX)loop(1)play())


This does not take into account anything like loop points etc.


Digital Sounds

SCI0 originally did not directly support the use of digital samples. Some of the MT-32 tracks included low-quality PCM samples for sound-effects. Towards the end of the SCI0 era, Sierra started adding digital sounds to the resources. Initially, these were appended onto a SOUND resource and played the SoundBlaster driver. There are also some drivers for MT-32 and GM that will play both music for the targeted MIDI device and the PCM sample through the SB. Examples of the embedded PCM samples can be found in Space Quest III (Rodger's "Where am I") and in later games such as Quest for Glory II (genie's laugh in the intro).

AddWav

The AddWav utility can embed a digital sample in a SOUND resource to include in an SCI0 game. This method has some limitations. The WAV file must be 8-bit mono and the resulting sound resource must be no bigger than 65536 bytes. Also, the game's configuration file (RESOURCE.CFG) must be set to either SNDBLAST.DRV or MTBLAST.DRV drivers for the digital sound to be played.

The SCI Sound Utilities includes a GUI interface for AddWav to simplify appending a PCM sample to a SOUND resource. It uses an empty SOUND file and will automatically down sample your WAV file to be small enough to embed. It can also do bulk processing of multiple PCM WAV files.

 

sciAudio

An add-on utility made by Gumby makes use of the Google app Narrate and SCI0's ability to output text to a file to be able to use external audio resources controlled by your SCI scripts. The sciAudio app makes it easy to use a range of audio formats.


See also

 

< Previous: Cloudee1's SCI Point and Click Tutorial Back to Tutorials Index >