Table of Contents

Class ThunderSynth

Namespace
FishMMO.Client
Assembly
FishMMO.Client.dll

The thunder of one lightning strike as heard from one place, synthesised from the strike's own channel.

public static class ThunderSynth
Inheritance
ThunderSynth
Inherited Members

Remarks

Thunder is the channel, heard piece by piece. The return stroke heats every metre of its tortuous channel at once, and each piece bursts outward as a shock that relaxes, within metres, into an N-wave: a sharp rise, a linear fall through zero, a sharp return (Few 1969). Each piece's wave reaches the listener after its own distance over the speed of sound, so a channel kilometres long is heard over many seconds: first the nearest piece's crack, then the roll of the rest, loudest where long straight runs of channel lie broadside to the listener (each piece radiates most at right angles to itself) and their waves arrive together. That is why thunder rolls, and why each clap is different.

The channel. The visible bolt (SkySchedule.BoltPath: its trunk and branches) made tortuous at a finer scale, plus the channel hidden inside the cloud — a strike's in-cloud leader runs kilometres sideways at the cloud's base, which is where the long rumbles come from. All of it is drawn from the strike's seed, so every client makes the same channel.

The air. Each wave falls with distance (spherical spreading, 1/r), stretches a little as it goes, and loses its highs to absorption — its sharp edges rounded, tens of microseconds near and milliseconds far — so the dulling is continuous with distance. The ground under the listener returns each wave a moment later (its image), and the ground, the hills and the cloud scatter it back into a long diffuse tail.

Checked against recordings (2026-10-19). Six field recordings of thunder: energy peaks in the 63–500 Hz octaves (centroids 110–520 Hz), within 20 dB of the peak for 3–18 s, rising over 0.3–3 s for a far roll and at once for a near crack, decaying smoothly. The first version of this put its energy at 16–63 Hz (N-waves several times too long), buzzed (pieces evenly spaced arrive evenly), jumped where distance bands met, and stopped dead when the last piece arrived.

Fields

GroundReturn

The share of each wave the ground under the listener returns.

public const float GroundReturn = 0.7

Field Value

float

GroundRoughnessMetres

Metres the ground's return wanders per source (one standard deviation): rough ground, coherent only at low frequencies.

public const float GroundRoughnessMetres = 0.4

Field Value

float

KinkMetres

Metres between the kinks of the channel at its finest: the length of its straight runs.

public const float KinkMetres = 8

Field Value

float

ScatterSeconds

The decay time, seconds, of the scattered tail from a near strike; further strikes ring longer.

public const float ScatterSeconds = 4

Field Value

float

SourceMetres

Metres of channel each point source stands for, scattered at random along its segment.

public const float SourceMetres = 1

Field Value

float

StrengthSpread

The spread of the channel's strength along it (the log-normal's sigma): what makes thunder come in peals rather than a steady rumble. Fitted so the envelope's flutter matches the recordings' (about 0.4).

public const float StrengthSpread = 0.9

Field Value

float

ThunderRate

The thunder's sample rate: its energy is almost all below a few kilohertz.

public const int ThunderRate = 22050

Field Value

int

Methods

AddCloudChannel(Channel, Vector3, float, uint)

Adds the strike's in-cloud channel to channel: two to four runs from the top of the bolt along the cloud's base, four to twelve kilometres in all (a cloud-to-ground flash's in-cloud leaders commonly span five to fifteen), wandering as a leader does. Recorded rolls go on pealing ten seconds and more after the first crack; it is these runs, kilometres further off, that do it.

public static void AddCloudChannel(ThunderSynth.Channel channel, Vector3 top, float cloudHeight, uint seed)

Parameters

channel ThunderSynth.Channel
top Vector3
cloudHeight float
seed uint

Period(float)

An N-wave's period at a distance: about 2 ms close by, lengthening slowly with the log of the way it has come as the wave stretches. Summed along the channel (the coherent runs add their lows) that puts the thunder's energy in the 63–250 Hz octaves, where the recordings have it.

public static float Period(float metres)

Parameters

metres float

Returns

float

Render(Channel, Vector3)

The thunder of a channel heard at listener. Pure arithmetic: safe off the main thread.

public static ThunderSynth.Result Render(ThunderSynth.Channel channel, Vector3 listener)

Parameters

channel ThunderSynth.Channel
listener Vector3

Returns

ThunderSynth.Result

RiseSeconds(float)

How long an N-wave's sharp edges take to rise once the air has dulled them, seconds: tens of microseconds close by (a crack bright to 8 kHz), milliseconds kilometres off (the air's absorption takes the highs first).

public static float RiseSeconds(float metres)

Parameters

metres float

Returns

float