Webaudio Motor

 from Red Blob Games
23 Nov 2021

I wanted to play with a procedurally generated motor sound. I had previously played with this in 2016. It may be useful for a propeller plane. Try starting the sound then increasing the speed.

Speed: Brush/Rotor:

Minor WebAudio annoyance: you can’t start a node more than once! You have to create a new one every time you want to start it. They say though that these are lightweight objects so it shouldn’t matter.

Minor WebAudio annoyance: some browsers won’t start the audio until a user event, so you need to structure your code differently. https://developer.chrome.com/blog/autoplay/#webaudio[1]

Physically informed car engine sound synthesis for virtual and augmented environments[2] is an interesting read! They procedurally generate car engine sounds by modeling the ignition, pistons, fuel intake, resonance, vibration, backfiring, etc.

This video[3] also models the pistons, fuel, resonance, etc. to not only generate the car engine sounds but also estimate the horsepower.

Spaceship Sound Design Tutorial[4] was an interesting video for me, as I don’t know much about this topic. This talk by Andy Farnell[5] has a nice jet engine demo at 1:16:00.

One of the main ingredients for many sound effects is noise fed through a pass filter (band pass in this example, but low pass can be useful too). The Q slider is especially interesting to play with — higher values narrow the frequency range of the output and lower values widen it, making it more like white noise.

Frequency: Q:

Can’t reproduce: in 2021, sound stops playing in desktop Safari after a while, and changes to the slider lag quite a bit. Might be https://bugs.webkit.org/show_bug.cgi?id=231105[6] but mine stops playing even if it’s the foreground tab. It seems to be working in 2023.

Email me , or tweet @redblobgames, or comment: