Skip to main content

How to: Energy Beam sound

Energy beams are common in video games.

The sawtooth wave can be a good basis for the sound of an energy beam as it has a bit of harshness to it that can make the sound feel like the inner workings of a powerful weapon. Then vibrato and tremolo can be added to create the pulsating feel of an energy beam.

This is an example of how you could make the sound of an energy beam using .esfx:

Play(duration=2.5s, cutoff=0.25s) {
Vibrato(freqModulation=1) {
Oscillator(wave=$sine, freq=20)
}
Oscillator(wave=$sawtooth, freq=18, harmonics=[1,2.16,4.16])
Tremolo(volumeModulation=0.15) {
Oscillator(wave=$sine, freq=10)
}
LowPass(freq=200, q=1)
Envelope(attack=0.1s, sustain=true)
}

First, we want to create a sound that can keep playing for the entire duration of the energy beam firing, so we set the duration of the Play block to 2.5 seconds. We expect the energy beam can be fired for different durations, so we set the cutoff parameter to 0.25 seconds to fade out the sound if it is cut short.

The main Oscillator is a sawtooth wave at 18 Hz, which creates a low rumbling sound. The sawtooth is a good choice because it has a lot of harmonics frequencies on top of the base frequency that make the sound more complex, as opposed to a sine wave which only consists of the base frequency. This gives us something to shape and filter to create the sound of the energy beam.

The way to create harmony is to have the harmonics be simple ratios of the base frequency. Instead of setting our harmoncs to a perfect [1,2,4], we use [1,2.16,4.16], which creates disconcordant harmonics that makes the sound more grating, as if there are multiple energies fighting for dominance inside the energy beam.

The Vibrato and Tremolo functions modulate the frequency and volume of the main Oscillator to make it sound like the beam is pulsating with energy. We use a low frequency for both the Vibrato and Tremolo (below the minimum frequency of human hearing 20 Hz) so you can actually hear the individual pulses of the energy beam.

The LowPass function filters out frequencies above 200 Hz, which keeps the deep rumbling and makes the sound less harsh.

Finally, the Envelope function makes the sound ramp up to maximum volume over 0.1 seconds as the energy beam powers up. We set sustain=true because we want the sound to stay at maximum volume until the energy beam stops firing.