Skip to content

Jonas-Hack/Granular-Synthesis-for-Engine-Audio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

This is a small script, which uses granular synthesis to dynamically alter engine sounds in Unity.

Inspired by this video by Francesco Cucchiara.

Concept

This script uses granular synthesis to dynamically mimic engine sounds.

More specifically it makes use of granulation of sampled sound. The script doesn't speed up or pitch shift the input sound, but traverses it based on engine RPM.

It separates an input sound into smaller sections called grains and adjusts them to avoid clipping. During runtime it chooses a grain, which resembles the wanted RPM of the virtual engine. To make the granulation less noticeable, grains are cross faded (through so called envelopes) and some variation (in the form of slightly randomized RPM) is added.

Usage

Provide a recording of an engine accelerating from idle to maximum RPM, without any additional sounds, as an input audio clip. Use long and high quality recordings. Works better with engines, which don't have slow and clearly audible pistons.

To get good results parameters need to be tweaked to fit your engine sound clip. Specifically the grain time (in milliseconds) can have a big influence on output quality. A longer grain time is true to the input sound but may lead to more noticeable cuts. Short grain times can lead to noise and create underlying frequencies.

The envelope time (duration of clip cross fade) should be kept to around a third of the grain time.

For debugging I used this and this sound by "Soundholder", cut to only the engine revving.

Limitations

This system has no information on when and for how long pistons are audible. Therefore it may sometimes cut them off. It may also lead to slightly irregular rhythms. This can make the granulation easy to hear and ruin the illusion of a continuous engine sound. Some way of adjusting the grain sizes and positions to encompass a single firing of the piston each could solve this problem. At this point, that is outside the scope of this little project. When using engines without clearly audible pistons, the results sound quite good, although slightly sci-fi.

Releases

No releases published

Packages

No packages published

Languages