Reverb#

Positioned reverb zones. The engine blends every reverb whose roll-off radius overlaps the listener into a single shared reverb processor.

Upstream: YSE::reverb.

The named presets are also available as plain values: ReverbPresetValues.fromPreset() returns the exact parameter set Reverb.preset applies, ReverbPresetValues.lerp() blends two sets with the engine’s own morph core, and Reverb.applyValues() applies any set to a zone. fromPreset and lerp need the library but no engine session.

Reverb#

class Reverb implements Finalizable

A positioned reverb zone.

Each reverb holds a set of parameters and a position in the scene. At the end of every DSP frame the engine blends every reverb whose rolloff radius overlaps the listener into the single shared reverb processor — so dropping multiple zones around the world (cave, hall, bathroom) lets the listener transition smoothly between them.

A fallback “global” reverb is also available via [System.globalReverb]; it’s mixed in wherever no positioned zone reaches.

Constructors#

factory Reverb.borrowed(Pointer<YseReverb> handle)

Internal: wrap a borrowed pointer (the global reverb singleton).

factory Reverb()

Construct a new positioned reverb zone.

The native [reverb::create] runs implicitly; the handle is ready to configure immediately.

Properties#

bool get isValid

Whether this reverb has a live native implementation.

Pos get position
set position(Pos value)

Position of the zone in the scene.

double get size
set size(double value)

Radius within which the reverb is at full strength.

double get rollOff
set rollOff(double value)

Distance over which the reverb fades to zero beyond [size].

bool get active
set active(bool value)

Whether this reverb zone contributes to the listener mix.

double get roomSize
set roomSize(double value)

Simulated room size. Larger values give longer tails.

double get damping
set damping(double value)

High-frequency damping. Higher values darken the tail faster (soft-material simulation).

double get dry

Current dry-signal level.

double get wet

Current wet-signal level.

double get modulationFrequency

Current modulation frequency in Hz.

double get modulationWidth

Current modulation width.

set preset(ReverbPreset value)

Apply a named preset.

Methods#

void setDryWetBalance({required double dry, required double wet})

Set the dry/wet balance in one call.

[dry] is the unprocessed signal passthrough, [wet] is the reverberated mix. Sums above 1.0 can clip.

void setModulation({required double frequency, required double width})

Add a slow LFO to the tail to break up metallic resonances.

void setReflection(int reflection, {required int time, required double gain})

Configure one of the four early reflections (index 0..3).

int getReflectionTime(int reflection)

Delay time of the early reflection at [reflection] (0..3).

double getReflectionGain(int reflection)

Gain of the early reflection at [reflection] (0..3).

void applyValues(ReverbPresetValues values)

Apply a complete parameter set — room size, damping, dry/wet balance, modulation and the four early reflections — exactly as [preset] applies a named one. Each reflection time is truncated to whole samples.

Pair with [ReverbPresetValues.lerp] to place a zone part-way between two presets:

zone.applyValues(ReverbPresetValues.lerp(
  ReverbPresetValues.fromPreset(ReverbPreset.room),
  ReverbPresetValues.fromPreset(ReverbPreset.hall),
  0.3,
));
void dispose()

Destroy the underlying native reverb and detach the finalizer.

No-op for the borrowed global reverb. Idempotent.

ReverbPresetValues#

class ReverbPresetValues

A complete reverb parameter set — the full payload behind a named [ReverbPreset], and the custom endpoint type for a [MorphingReverb] slot.

Immutable value type. Mirrors the C YseReverbPresetValues (itself a plain-data mirror of YSE::REVERB::presetValues). [earlyTimes] and [earlyGains] each describe the four early reflections and are always length 4.

Constructors#

ReverbPresetValues({this.roomSize = 0, this.damping = 0, this.dry = 0, this.wet = 0, this.modulationFrequency = 0, this.modulationWidth = 0, List<double>? earlyTimes, List<double>? earlyGains})

Construct a parameter set. [earlyTimes] and [earlyGains], when supplied, must each have exactly four elements; both default to all-zero.

factory ReverbPresetValues.fromNative(YseReverbPresetValues native)

Read a native YseReverbPresetValues struct into a Dart value.

factory ReverbPresetValues.fromPreset(ReverbPreset preset)

The exact parameter set that Reverb.preset = preset applies, read from the engine’s preset table. Needs the library but no engine session.

Static methods#

static ReverbPresetValues lerp(ReverbPresetValues a, ReverbPresetValues b, double t)

Linear blend of [a] and [b]: every field is interpolated with [t] clamped to [0, 1], so t == 0 returns [a] and t == 1 returns [b] exactly. Delegates to the engine’s own morph core, so the result is bit-identical to what a [MorphingReverb] computes. Needs the library but no engine session.

Properties#

final double roomSize

Simulated room size, [0, 1]. Larger values give longer tails.

final double damping

High-frequency damping, [0, 1].

final double dry

Unprocessed (dry) signal level, [0, 1].

final double wet

Reverberated (wet) signal level, [0, 1].

final double modulationFrequency

Tail modulation rate in Hz (0 = off).

final double modulationWidth

Tail modulation depth (0 = off).

final List<double> earlyTimes

The four early-reflection delay times, in samples ([0, 2999]).

final List<double> earlyGains

The four early-reflection gains, [0, 1].

int get hashCode

Methods#

bool ==(Object other)
String toString()