Weather and environment sound engine
Weather you
can direct.
Rain, wind and thunder, simulated from physics. Describe it in plain words and it plays, endlessly, never looped.
Listen
Headphones recommended. Nothing plays until you press.
Watch for a flash, then count: thunder at 6.0 km arrives 17.6 s later.
Sound in space
Every drop has a place.
Rain lands all around you. Wind arrives from its bearing. Thunder reaches you after the flash, at the speed of sound in that air.
- Around the listener 3DEvery impact, gust and thunderclap is placed in the scene and heard from where you stand.
- Stereo 2.0Two speakers at ±30°, folded down from the full scene.
- Surround 5.1Rain all around, thunder from its bearing, low end on the LFE, with the right WAVE channel masks.
- Immersive 7.1.4Four height channels put the rain overhead. Binaural for headphones, and AmbiX ambisonics, first to third order, for 360 video, VR and game engines.
Physics, not loops
Rain is a population of drops.
raingen simulates the drops, the surfaces they strike, the wind in trees and wires, and the air the thunder crosses to reach you. Nothing is a recording, so nothing repeats.
- 14.9kHz
The ring of a 0.22 mm bubble, trapped when a small drop hits water.
Minnaert · Medwin, Nystuen et al. 1992 - 9.14m/s
How fast a 5 mm drop lands. Bigger drops land harder, and you hear it.
Atlas 1973 fall speeds - 2.91s/km
Flash to bang at 20 °C. In colder air it stretches to 3.08 at −10 °C.
Speed of sound c(T)
The 4D Composer
Build the world.
Then walk into it.
Put a tin roof over the listener, set an oak beside it, string a power line, draw the storm's track, then walk through it in first person. It runs in your browser, and nothing is uploaded.
For your work
Wherever weather has to sound real.
Film and TV
Stems, BWF with timecode and the scene in iXML, 7.1.4 and ambisonics, UCS names, and EDL cue sheets for every thunderclap and gust.
Games
Parameters in human units, a real-time engine with smooth glides, Wwise and FMOD manifests, and a seed per scene so QA can reproduce any bug.
Music
Thunder one-shot packs with UCS names, stems that mix like any other track, and OSC control of the live engine.
Sleep and focus
Relax, Sleep and Focus modes with low default levels, a timer and a long fade-out. No sudden loud sounds, and no loop for your ear to learn.
Apps and installations
A browser engine on Web Audio, a Python library and CLI, and one open scene format between them. METAR, disdrometer and live-weather import.
Developers
Plain words in.
Sound out.
A Python library, a CLI and a browser engine that share one scene format. Every example runs as shown.
import raingen as rg
# 1 · Just listen (real time; Ctrl+C stops; needs the "audio" extra)
rg.play("rain on a tent, gusty, distant thunder")
# 2 · Plain words → file (streams to disk; any length)
report = rg.render("rain on a tin roof, wind 30 km/h from the west, distant thunder",
minutes=60, out="cabin_storm.wav", destination="youtube")
print(report) # the file, loudness, true peak, events and the words it understood
# 3 · Human units, one canonical path per parameter
scene = rg.preset("tent-in-a-storm")
scene.weather.precipitation.rate_mm_h = 8
scene.weather.wind.speed_mps = rg.beaufort(5) # 9.3 m/s, "fresh breeze"
scene.weather.wind.from_deg = 270 # meteorological "from": the west
scene.weather.thunder.distance_km = 3 # ≈ 8.7 s flash-to-bang at 20 °C
print(scene.describe()) # "What am I hearing?" in plain words
scene.save("my_tent.json") # the whole storm in about 2 KB
# 4 · Long renders stream to disk in bounded memory
scene.render(hours=10, seed=42, out="tent_sleep.wav", destination="sleep", mode="sleep")
# 5 · Studio: automation, stems, 7.1.4, cue sheets, timecode
from raingen.scene.timeline import ramp
scene.timeline += ramp("weather.precipitation.rate_mm_h",
[(0, 0.5), ("05:00", 25), ("12:00", 2)], curve="log")
rg.render(scene, minutes=12, out="storm_714.wav", layout="7.1.4", stems=True,
captions=("srt", "edl"), start_tc="01:00:00:00", destination="post_stems")
# 6 · A thunder one-shot pack with UCS file names
rg.one_shots("thunder", count=12, out_dir="thunder_pack/")
# 7 · Variations for a sound library or a game: derived seeds, small jitter
for v in scene.variations(20):
v.render(seconds=90, out_dir="library/") # UCS-named files
# 8 · Real time: parameters glide, structural changes crossfade
with rg.Engine(scene, layout="binaural") as eng:
eng.set("weather.wind.speed_mps", 14, ramp=2.0)
eng.set("weather.thunder.distance_km", "2 km", ramp=30)
eng.set("place.shelter", "car")
eng.run(60)
raingen play "rain on a tent, gusty" # real time; Ctrl+C stops
raingen render "heavy rain on a car roof, wipers on" --minutes 30 --out car.flac --destination youtube
raingen scene tent-in-a-storm --out my_tent.json
raingen render my_tent.json --hours 10 --layout binaural --destination sleep --mode sleep
raingen render tin-roof-cabin-storm --minutes 5 --stems --captions srt edl
raingen variations tent-in-a-storm --count 20 --seconds 90 --out-dir library/
raingen metar "KJFK 121755Z 21016G24KT 1SM +TSRA BR BKN015CB 18/17 A2990" --minutes 10 --out jfk.wav
raingen live --place "Bergen, Norway" --minutes 5 --out bergen.wav # the weather there now
raingen play focus-steady-roof --osc 9000 # OSC control on UDP port 9000
raingen presets --tag sleep
raingen destinations
raingen manifest --format wwise --out raingen_wwise.json
{
"rainscene": 1,
"name": "Tent in a storm",
"seed": 1592642302,
"weather": {
"precipitation": { "type": "rain", "rate_mm_h": 8, "drops": "normal", "character": "showery",
"shower_period_min": 12, "hail_size_mm": 13 },
"wind": { "speed_mps": 9.3, "from_deg": 270, "gust_factor": 1.8 },
"thunder": { "enabled": true, "distance_km": 3, "bearing_deg": 300, "approach_kmh": 15,
"flashes_per_min": 2, "stroke_intensity": 0.6 },
"temperature_c": 14, "humidity_pct": 92, "hour": 23, "season": "autumn",
"storm_arc": "arriving", "arc_minutes": 20
},
"place": {
"preset": "conifer_forest", "shelter": "tent",
"surfaces": { "leaves": 40, "soil": 30, "puddle": 10, "fabric": 20 },
"window_open": 0, "wipers": "off",
"objects": [
{ "id": "tent", "type": "tent", "material": "fabric", "position": [0, 0, 0],
"size": [2.2, 1.6, 1.2], "rotation_deg": 0, "params": {} },
{ "id": "pine-1", "type": "tree", "material": "leaves", "position": [-7, 4, 0],
"size": [5, 5, 18], "rotation_deg": 0, "params": { "species": "conifer", "height": 18 } },
{ "id": "storm-1", "type": "storm", "material": "", "position": [6000, 4000, 0],
"size": [8000, 8000, 10000], "rotation_deg": 0,
"params": { "track": [[6000, 4000], [-2000, -1500]], "speed_kmh": 25,
"flashes_per_min": 2, "intensity": 0.7, "radius_km": 4 } }
]
},
"listener": { "position": [0, 0, 0], "height_m": 0.5, "heading_deg": 0, "render": "binaural" },
"mode": "none",
"timeline": [
{ "at": 0, "path": "weather.precipitation.rate_mm_h", "value": 0.5, "curve": "log" },
{ "at": 300, "path": "weather.precipitation.rate_mm_h", "value": 25, "curve": "log" },
{ "at": 720, "path": "weather.precipitation.rate_mm_h", "value": 2, "curve": "smooth" }
]
}
import { WeatherEngine, defaultScene } from './engine/weather-engine.js';
const scene = defaultScene(); // the same rainscene format the CLI renders
scene.place.shelter = 'tent';
scene.weather.thunder.enabled = true;
const engine = new WeatherEngine();
await engine.start(); // call from a click: browsers need a gesture
engine.setScene(scene);
engine.setListener({ position: [0, 0, 0], headingDeg: 90 });
// a 12-second swell into a downpour
engine.setParam('weather.precipitation.rate_mm_h', 25, 12);
// sight and sound share one lightning channel: [x, y, z] points in metres
engine.on('flash', ({ channel, delaySec }) => console.log(`bolt of ${channel.length} points, thunder in ${delaySec.toFixed(1)} s`));
engine.on('thunder', ({ distanceKm }) => console.log(`thunder from ${distanceKm.toFixed(1)} km`));
// same graph, rendered offline to a 24-bit WAV Blob
const wav = await engine.renderOffline(90, { sampleRate: 48000 });
Install from the repository with pip install -e ".[audio]". The audio extra adds real-time playback and FLAC; osc adds OSC control. A saved storm is a rainscene JSON file of about 2 KB that the Composer, the browser engine and the CLI all read.
Delivery
Pick a destination.
Pass QC.
A BS.1770-5 meter over the whole programme, a true-peak limiter that detects at 8× oversampling, and TPDF dither on every integer export.
| Destination | Loudness | True peak | Notes |
|---|---|---|---|
| YouTube · Spotify · music | −14 LUFS | −1 dBTP | −2 dBTP if the master is louder. FLAC for Spotify, 48 k/24 WAV for YouTube. |
| Apple Music | ≈ −16 LUFS | −1 dBTP | Unofficial target |
| Apple Podcasts | −16 LKFS ±1 | −1 dBTP | Stereo, 44.1 kHz or higher |
| Sleep video or app | −27 LUFS | −1 dBTP | Loudness range ≤ 4 LU, no event far above the bed, a long fade-out |
| EU broadcast · EBU R128 | −23.0 LUFS | −1 dBTP | BWF 48 k/24 with bext v2 loudness fields |
| Streaming broadcaster · R128 s2 | −18 LUFS | −1 dBTP | The middle of the −20 to −16 LUFS range |
| US broadcast · ATSC A/85 | −24 LKFS ±2 | −2 dBTP | Full-mix measurement for content with no dialogue |
| Online streaming · AES71 | −24 LKFS | −2 dBTP | One target inside the −23 to −27 LKFS range |
| Film and TV post stems | Not normalized | −2 dBTP | Calibrated relative levels; BWF with timecode and the scene in iXML |
| Game | Calibrated | −1 dBTP | Levels for middleware mixing, with Wwise and FMOD manifests |
| VR and 360 | Calibrated | −1 dBTP | AmbiX first order for 360 video; third order for engines |
- WAV, RF64 and BW64Past 2 GiB a file switches to RF64 in place, so a ten-hour render is one valid file.
- BWF and iXMLLoudness, timecode and coding history in bext v2, and the full scene in iXML.
- Every layoutStereo, binaural, 5.1, 7.1 and 7.1.4 with the right channel masks; AmbiX first and third order.
- Seven stemsRain near, rain far, wind and foliage, thunder, drips, ambience, and the shelter interior.
- Captions and cuesSRT and VTT captions; CSV and EDL cue sheets for thunder, gusts and flashes.
- UCS v8.2.1 names
RAINClth_Moderate rain on tent close, wind W 15kmh gusty_RGN_raingen
Hear the weather you have in mind.
Open the Composer, build a place, and start the storm.