Paged sounds can be heard anywhere within the level. A PAGE statement may be issued from an elevator or trigger. The following example is the INITIALIZE sector from Jungles of Caldoun, which plays the initial sequence of the Crow crashing into the foliage and Kyles trying to raise Jan. Please note that I added comments which do not belong into the INF file:
item: sector name: initialize
seq
class:elevator move_floor
event_mask: 0
sound: 1 0 The elevator mustn�t
sound: 2 0 play any sounds
sound: 3 0 of its own
speed: 0
stop: @0 0.2
stop: @1 5
message: 1 start_point wakeup Start the VUE immediately
page: 1 landing1.voc and play LANDING.VOC
stop: @2 0.2
message: 2 start_point next_stop Start the earthquake
page: 2 ex-med1.voc play EX-MED1
stop: @3 0.3
page: 3 ex-small.voc after 0.2 secs, play EX-MED2
stop: @4 4
page: 4 ex-med1.voc after 0.3 secs, play EX-MED1
stop: @5 3
page: 5 m02kyl01.voc 4 secs, then:"Jan...?"
stop: @6 2
page: 6 m02kyl01.voc 3 secs, then again "Jan...?"
stop: @7 1
page: 7 m08kyl05.voc Lost temper: "Aaah, Sh****".
stop: @8 terminate
seqend
You can run away from the initial sector, but you�ll still hear the sounds at full volume. That�s how PAGE works. In the following section, I want to give some hints of how to create your own sounds. Generally, there are three ways:
1. Take existing sound files and cut/paste them together.
I did so in the final sequence in Jungles of Caldoun, where - for example - Kyle says "we need more ships and more firepower". This is based on the files M05KYL03.VOC, and Allen�s ALSKYL23. M05KYL03 says "If that thing down there is any indication of what we�re dealing with, we�re gonna need more firepower". I just cut out the section "we�re gonna need more firepower". Then I extracted "ships" from ALSKYL23 ("Ok, Jan. Ship secured") with that convenient S following "ship". Where I got that "and" from I don�t remember. But by now you know how it works.
The result was stored in the file CALDKYL3.VOC.
2. Synthesize the sound.
To do this, you�ll have to have basic programming knowledge and you should have an idea how the sound looks like. Look at the file HISS.VOC from the Hunt for the Arc Hammer - you�ll realize a very clean exponential decay which could well be the result of a natural process - except that it is too clean (yes, that�s what I mean. Go ahead and load this file into your sound editor).
HISS.VOC was generated by a couple of lines of PASCAL code (which I slightly simplified for easier understanding):
Procedure Hiss (Duration: Real);
VAR R: Real;
Sign: Shortint;
I: Longint;
P1, P2, P3: Longint;
BEGIN
Randomize;
P1:=Round(11000*Duration); {No of samples}
P2 := P1 DIV 2; {Decay constant}
P3:=P1 DIV 30; {Attack constant}
FOR I:=1 TO P1 DO
BEGIN
R := Random ($F8);
IF R>=$80 THEN BEGIN Sign:=1; R:=R-$80; END ELSE Sign:=-1;
R:=R*Exp (-I/P2); IF I
PB := $80+Sign*Round(R);
Write (f,pb);
END;
END;
Please don�t discuss performance aspects of the code. This procedure just had to work and I wanted to get it ready FAST. So I just wrote it quick and dirty. P1 contains the number of samples as given by the sample rate of 11000 Hz and the duration. 3 % of the total duration is the attack time. The sound doesn�t start abruptly but needs a few miliseconds to come to it�s full amplitude. This time is determined by P3.
For each sample, I get a random number (random numbers generate white noise, a hissing sound). Then, it is either modulated linearly (attack period if i is less than P3), or it decays exponentially with the decay constant of P2. After that, the sign is restored, the floating-point value converted into a byte which is written to the file F. In this example, I removed a recursive filter which softens the high-frequency components
during the decay period, so that the example does not get too complicated.
Then, in the next step, you load this raw file into your sound editor and convert it into VOC format. Done.
This method allows you to create any sound which is described analytically. Sine-wave sounds, white or colored noise, etc. For those who are interested in this method, I�ll include another example, this time the soft humming sound of the force field in Jungles of Caldoun. You�ll recognize the scheme. It�s a sine wave of 100 Hz overlaid by a low-amplitude sine wave of 240 Hz.
Procedure Humm;
CONST Amplitude = $40;
VAR A,R: Real;
J: Integer; I: Longint;
BEGIN
A:=1; J:=0;
FOR I:=1 TO 11000 DO
BEGIN
R := Amplitude*sin (100.0*3.1415926*i/11000)
+ Amplitude/8.0*sin (240.0*3.1415926*i/11000);
PB := $80 + Round(R);
Write (f,pb);
END;
END;
If you have a certain sound in mind and you don�t think you can describe it with a simple formula, you�ll have to record it yourself. I can�t give you general hints - the only limit is your own creativity. Always remember that you can convert a recorded sound into RAW format, read it with the help of a small program, modify it (e.g. filtering, fourier transformation) and write it back as raw sound, ready for your sound editor.
I will provide a few examples, though, just to get your imagination going and to show what is possible.
The AUXPWR sounds are recorded from an ancient 8-inch, 10 MB Shugart hard disk drive. The heavy discs show this characteristical slow acceleration phase which I found very suitable for this supposedly heavy machinery.
Another hard disk was used to create the sounds WHINE.VOC and PROPAG.VOC in Jungles of Caldoun. This time, it was a 40 MB
Fujitsu 3.5" drive which recalibrates the heads immediately after startup. Whine.VOC is the acceleration phase played backwards (and with a part from LANDING2.VOC appended). PROPAG.VOC is the head calibration phase following the disc startup, played at half speed. This is what you hear after you activate the propagator (uppermost level of the installation) and at the antenna site, where it is a paged sound.
The third example is the Caldoun Wasp. It is no real wasp but an electrical toothbrush, converted to a higher pitch.
As I said, there are no real limits for the combination of recording/synthesizing sound, modifying it, and cutting parts together. I hope that the level creators among you will make heavy use of sound effects in both DF levels and the JK levels to come. Nothing can beat the atmosphere
created by well-used ambient sounds.