The Cacophony 2-D Sound Tool


The Cacophony tool allows you load up to ten sounds, and then alter the following:

  • Starting time for the sound

  • Starting and ending volume

  • Starting and ending panning positions

  • Starting and ending frequencies

Clicking on Cacophony.exe will bring up the dialog box shown in Figure 2.1.

click to expand
Figure 2.1: Main dialog box of the Cacophony tool.

You can use the Cacophony tool to experiment with small sound compositions to evaluate whether 2-D sound is right for your application. To load in a sound, first click on the radio button under the Select column to pick a slot for the sound to run in, and then click Add or Edit Sound. This will display the dialog box shown in Figure 2.2.

First, you must decide whether the sound is to start at a given time, or if it is dependent upon the completion of another sound. As this is the first and only sound that you are loading for this test, leave the Timed Start (Seconds) check box selected, and keep the start time at 0 seconds. For future reference, any start time up to 100 seconds (which is the maximum playing time of the tool) can be entered in this edit box.

click to expand
Figure 2.2: Add or Edit Sound dialog box for 2-D sounds.

If you are adding rather than editing a sound, the Add or Edit Sound dialog box will appear blank, as shown in the previous screen. Click the Sound File button, and then load in the  LIFTOFF.WAV sound.

The Distance (1-100) edit box determines the volume of the sound. For example, a distance value of 1 means that the sound will be played at its maximum volume (the volume at which the sound was recorded). In other words, a value of 1 means that the object producing the sound is at the same distance from the listener as the original sound source when the sound was recorded. A value of 2 in this box means that the sound volume will match that of an object twice the distance away from the listener as that of the original recording, and so on.

The default start distance is 1 (the maximum), but for this experiment, change this to 4 (which means that the starting volume matches that of an object four times the distance away from the listener as the original recording). Next , move the slider, still within the Sound Start group , over to the Far Left position.

Now, within the Sound End group, leave everything but the slider as is, and move the slider over to the Far Right position. For future reference, positions are based on a linear scale, with -50 being at the far left, and 50 at the far right. The default position of 0 is dead center.

Leave the Frequency settings at 100 to ensure that the sound will be replayed at its original frequency. For future reference, by changing the starting and ending frequencies, for example, to 50 for the start frequency and 150 for the end frequency, the sound will be replayed with the frequency changing from 50% of its original to 150%. However, it is difficult to find the desired sounds by randomly playing with the frequency “ you ll get a lot of groans and whines before you find an acceptable effect.

Now click OK to close this dialog box and go back to the main Cacophony dialog box. What you should see on the screen is that for Sound 1, the Time has been set to 0.000, the Sound to LIFTOFF.WAV, the Start/End Distance to 4 1, the Start/End Position to -50 50, the Start/End Frequency to 100 100, and the Next Sound to 0 .

What this means is that the LIFTOFF sound will start in the far left position at one quarter of its recorded volume, and then move evenly between the left and right speakers , increasing steadily in volume until it is at its maximum when it reaches the far right position. Try it by pressing Play. Although it s a simple application, it encourages you to imagine more complex possibilities.

Going on to other features of the tool, you will notice that the Time cursor at the bottom of the dialog box keeps moving, even though the sound has stopped . To reset this cursor, press Stop. The Time cursor marks the playing time up to the maximum of 100 seconds, which was mentioned earlier in this chapter, and the internal timer for the tool sends a timing message every eighth of a second. This means that sounds can be started accurate to one eighth of a second, and also that changes to the volume, panning position and frequency are updated every eighth of a second. Of course, these latter updates will only occur if the starting and ending values for volume, panning position or frequency are different.

Most of the other buttons in this dialog box are pretty obvious. For example, Delete Sound deletes the sound in the slot identified by the Select radio button, and the New button eliminates all of the sounds.

Perhaps more interesting features of the Cacophony tool are Next Sound, Load Cacophony and Save Cacophony. The Next Sound column contains a sound number if you indicate in the Add or Edit Sound dialog box that, when the sound stops playing, it should start another sound. To do this, enter a number between 1 and 10 (be sure to use a number with a sound actually loaded into that slot) in the On Completion Run Sound Number edit box. Using this fun option, you can hear sound sequences such as a crash being heard just after a screeching, whizzing, or falling sound has ended.

The last option in the Add or Edit Sound dialog box is the End Values = Start Values button. Click this button if you want exactly the same volume, position and frequency for the Sound End group as you do for the Sound Start group, and can t be bothered playing with the edit boxes and slider.

Back in the main dialog box, the Load Cacophony and Save Cacophony options let you save your compositions for the next time that you run the tool. These files are saved as text files (with a .txt file name extension), so they can be examined in Microsoft Notepad, or any other plain text editing tool.

If you click on Load Cacophony, you ll notice that there are a number of cacophony files (all with the .cac file name extension) available to demonstrate different aspects of this tool. If you have not done so already, check out these files, and perhaps create some of your own noises, remembering to save the ones that you would like to hear again. The cacophony file  CannonExchange.cac demonstrates the use of panning to create moving effects, and the  DistantCannons.cac file shows how the volume is affected by increasing the distance away from the listener (see Plate 1).

The following list contains the contents of the  CannonExchange.cac cacophony file. Basically, it consists of the sound number (based 0 to 9 rather than 1 to 10 of the UI), followed by the path and file name of the sound relative to the AVBook directory, and then the settings. Only non-zero settings are saved “ the format is the setting slot followed by the value, and ending in the number 999. This method of saving settings makes the tool easier to extend rather than just listing the values. Note that the word empty is used to denote an unused slot. This file format is not a Microsoft format, it is simply a format invented by the creator of this tool.

 0 Audio\Old military\Cannon.wav* 0 1 2 4 4 100 5 4 7 100 8 3 999  1 Audio\Old military\Cannon.wav* 0 1 1 16 2 5 4 100 5 5 7 100 8 4 999  2 Audio\Old military\WHISTLE.wav* 2 4 4 100 5 1 6 100 7 100 8 5 999  3 Audio\Old military\WHISTLE.wav* 2 5 4 100 5 1 6 100 7 100 8 6 999  4 Audio\Old military\IMPACT.wav* 2 1 3 100 4 100 5 1 6 100 7 100 999  5 Audio\Old military\EXPLODE.WAV* 2 1 3 100 4 100 5 1 6 100 7 100 999  6 Audio\Old military\HGUN.wav* 0 1 1 64 2 1 3 100 4 100 5 1 6 100 7 100 8 8 999  7 Audio\Old military\WHISTLE.wav* 2 1 3 100 4 100 5 4 7 100 8 9 999  8 Audio\Old military\EXPLODE.WAV* 2 4 4 100 5 4 7 100 999  9 empty* 

This wraps up our discussion of the user guide for the Cacophony tool. The next section examines the tool s code.




Fundamentals of Audio and Video Programming for Games
Fundamentals of Audio and Video Programming for Games (Pro-Developer)
ISBN: 073561945X
EAN: 2147483647
Year: 2003
Pages: 120

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net