RainThunder

A procedural rain and thunder app: RainThunder.jar

Sample of audio output: RainThunderDemo.ogg

I wasn’t sure whether to put this in a new thread or add it to the “forest ambience” thread from a short while ago. I think this is ready to show, despite there being room for improvement. It is a mild thunderstorm, not supercharged, Hollywood-level drama.

The source sf/x files came from http://freesound.org/people/lennyboy/sounds/244053/, if you are curious as to the original sound cue. I use about half of this cue (7 seconds).

The main new component is a “ClipSectionPlayer” tool. With it, you can specify sections of clips (my equivalent of the Java Clip, not javax.audio.sampled.Clip itself), and play them as a chain. Start and end frames are required. At this point a single cross-fade length is used for all the seams.

I vary the playback frequency to get different “intensities” (ranging from something like 1/2 speed to 3x’s speed). At the faster playbacks, code adds more and longer sections to achieve similar lengths throughout the intensity range. It wouldn’t be too hard to make the event length an independent parameter.

One challenge was making the taper long enough not to sound abrupt with the faster playbacks, without bringing in a long sample. After trying several approaches, I tried a crude granular approach: the first half of the decay sample is broken into many short overlapping fragments which are chained. Most of the thunder events, thus are made from just a few longer sections for the body, followed by numerous but shorter sections from the “tapering” sample.

The rain and wind use a clip-slicer tool (explained in earlier posts). I made a crude low frequency (LF) “noise” tool, to vary the volume of the rain and wind. At this point, the tool varies the “wind” slightly before the “rain”, and errs on the side of subtlety. It seems to me, the LF noise wave should be filtered slightly (maybe with simple box filter) before using with the rain, on the theory that the rain reflects the sum of wind gusts occurring during its fall. Having a variable high-Q filter for the wind would be very helpful for more theatrical wind effects. As it stands, the wind is almost more a texture-thickener for the rain than something that reads clearly in its own right.