1

In a snow-simulation that I implemented there are thunderbolts in the background.
I never before worked with any generic sound effects.

What I am trying to ask is for a way to create a thunderclap sound programmatically so that I can define the duration and intensity of the clap and get a sound that matches the flash.

The flashes are random (there start, duration and the pause inbetween).
Its done with javascript and runs in a browser (html5+canvas).
That shouldn't matter though as I am not looking for any ready-to-use code but more for a concept, algorithmic idea or just basic information (links) on how to actualy start with such a task.
Maybe it would be an option to take a thunderclap sound and squeeze/stretch it? No idea on how to start with that either though ^^
Any hints are welcome.
In advance: Thank you all very much :-)

user3440145
  • 793
  • 10
  • 34

1 Answers1

0

There are a couple of ways of going about this. My advice would be to take a sampling approach and look around online looking for free-use thunder clap recordings.

If you're looking to actually synthesize the thundersounds from scratch, then you're going to have a more difficult time. The easiest and most CPU efficient way I can currently think of is looking for some FM synthesis recipes for thunder claps.

When it comes to adjusting the duration of the Thunder claps, your simplest option would be have an amplitude envelope that you can resize depending on the duration you want for the sound. The amplitude envelope can also be used to control volume and intensity of the clap.

Heres a nice reference to web audio api

http://www.html5rocks.com/en/tutorials/webaudio/intro/

Also, if you're looking for free samples, check out freesound.

https://www.freesound.org/

PicnicTripper
  • 295
  • 1
  • 3