DSP Implementation
465
close (less than 500m) has an incredibly loud and sharp bang to it, com-
pletely unlike the “castle thunder” we are simulating here. But further away it’s
unusual to hear the bang in a well-defined way, since spreading of the shock-
waves has already begun. So, this part represents a cheap compromise. You
may like to experiment with adding your own initial strike sounds to the effect,
perhaps using techniques we will explore later on the subject of explosions.
Damped N-Wave Rumble Generator
Following the initial strike, which comes from the closest part of the lightning
near the ground, come the time-delayed shockwaves propagated to make a rum-
ble. Perhaps the most difficult part of a good thunder sound is to create this
texture for the rumble properly. Using only low-passed noise produces poor
results that are no good for anything but a cartoon sketch. However, following
the physical model given by Few (1990, 1982) and Ribner and Roy (1982) is a
computationally expensive way to go about things, and certainly not possible
to use for real-time procedural game audio objects on current microproces-
sors. Several shortcuts have been discovered while attempting to make thunder
sounds for film use, and some are capable of producing astonishingly realistic,
even frightening thunder sounds, but all are a bit too complicated to describe
here. What we need is something that works a lot better than filtered noise,
but is simple enough to understand and create for this practical.
Figure 40.8
Rumble signature.
A shortcut to generating hundreds or thousands of
separate N-waves and mixing them with different delays
to create a thunder roll is shown in figure 40.8. This can-
not create the detailed initial strike, which is why we’ve
used a noise-based approximation, but it can give some
nice detail to the main body of the thunder effect. It
works by producing a randomly rising and falling ramp
which is then shaped to produce parabolic pulses with
a controllable density. We start with two independent
noise generators (it’s important that they are indepen-
dent, so this operation cannot be factored out). Each
is subjected to a second-order low-pass filter to get a
slowly moving signal. In the right branch we rectify this
signal, taking only the positive part with
, and then
it is scaled to drive a phasor. A multiplier of 3
,
000 is
necessary to recover the rather small level after such
strong filtering. The
is driven at around 10Hz to
20Hz. A similar process is applied to the noise in the cen-
tral branch; however, it isn’t rectified, because we want
a slow signal swinging positive and negative. Both are
combined with
. Falling edges from
freeze
the value on the left inlet of
to produce a stepped
waveform with random step heights and change inter-
vals. This is integrated by
to provide a “wandering
Do'stlaringiz bilan baham: |