OpenTPW

AUDIO-039: Bound device reverb fidelity#

Status and classification#

Current findings at cb625bfe#

Record decoding#

ReverbSettings.FromRecord accepts only a 13-word record and returns null for every other length (source/OpenTPW/Audio/ReverbUnit.cs:8-17). Words 0, 3, 4, 7 and 9 are integer fields; words 1, 2, 5, 6, 8, 10, 11 and 12 are single-precision floats. The record's field order is documented in the source comment as the order the original sends to its device (ReverbUnit.cs:4-8); this audit did not independently verify that historical claim.

Network and parameter handling#

State and reset behavior#

Existing tests inspected#

source/OpenTPW.Tests/ReverbUnitTests.cs already covers: record word order and wrong-length rejection; inactive unit and null preset; a longer decay preserving more impulse-tail energy; a lower reverb level being quieter and a lower high-frequency ratio darkening the tail; an early-reflection arrival at its configured delay; mixer routing of only positioned effects; and a sustained return staying below the dry level. It does not assert exact silence under a zero send, the pre-delay's full shift of the tail, the null/size reset distinction, or the clamp boundaries.

Added characterization contracts#

source/OpenTPW.Tests/ReverbUnitContractTests.cs uses a synthetic 44,100 Hz constructor rate and synthetic input only. It supplies the rate directly to ReverbUnit; it makes no claim that AudioMixer.OutputRate or runtime routing uses that value. Clamp-pair comparisons use exact sample equality because the two settings reach the same configured values, not as a claim of numerical equivalence to an external oracle.

Designed assertions, pending execution:

TestExact source-defined behavior asserted (not yet executed)
AnImpulseIsSilentBeforeTheDelayLinesAndThenDecaysA synthetic impulse with no early reflections is exactly zero for the first 1000 frames, produces nonzero energy after the delay network, and has less than one tenth of the early-window energy in a window near one second with a 1 s decay.
TheReverbDelayShiftsTheWholeTailWith reverbDelay = 0.02 s, output is exactly zero for 882 frames and is the sample-for-sample shift of the reverbDelay = 0 response by 882 frames thereafter.
AZeroSendProducesNoOutputEvenAtTheLongestDecayAn all-zero send remains exactly zero for two seconds under size 100 m, diffusion 1, decay 20 s, high-frequency ratio 0.1 and reverb delay 0.1 s; the network is not self-excited by its clamped maximum settings.
SetNullStopsTheReturnWithoutTouchingTheOutputAfter a tail exists, Set(null) plus a zero-send Process adds nothing and leaves a caller buffer prefilled with 0.25 exactly unchanged.
AReenabledPresetKeepsTheTailUnlessTheEnvironmentSizeChangesAfter Set(null) interrupts processing, re-enabling the same size continues a nonzero tail; re-enabling with a changed size (7.5 m to 30 m) rebuilds the lines and yields exactly zero for a zero send.
TheEnvironmentSizeIsClampedToItsConfiguredRangeSizes 0.1 and 1.5 produce identical samples; sizes 100 and 1000 produce identical samples.
TheDecayTimeIsClampedToItsConfiguredRangeDecay times 0.01 and 0.1 produce identical samples; 20 and 100 produce identical samples.
TheHighFrequencyDecayRatioIsClampedAndSaturatesAtNoDampingRatios 0.01 and 0.1 produce identical samples; ratios 1 and 10 produce identical samples, consistent with no damping at or above 1.
TheDiffusionIsClampedToItsConfiguredRangeDiffusion -1 and 0 produce identical samples; 1 and 2 produce identical samples.
TheReverbDelayIsClampedToItsConfiguredRangeReverb delays -1 and 0 produce identical samples; 0.1 and 1 produce identical samples.
ReflectionsRequireBothTheirDelayAndLevelThresholdsWith the wet level at its floor, a 0.0019 s reflection delay yields exactly zero early output, 0.002 s yields a nonzero tap; reflection level -10000 mB yields exactly zero early output, -9999 mB yields a nonzero tap.
TheReflectionDelayIsClampedAtItsUpperBoundReflection delays 0.3 and 1 s produce identical samples.
TheCombinedReverbLevelHasAMinus10000MillibelFloorThe pairs (room -10000, reverb -10000) and (room -20000, reverb 0), plus (room -15000, reverb -5000) and (room -10000, reverb -10000), produce identical samples because all reach the floor.

Tested claims versus unproven cases#

Covered by the designed assertions (subject to later exact-head CI)#

Not established#

Missing evidence and exact paths#

Historical context (carried from the prior plan-only draft)#

The following is historical material from the earlier version of this proposal. It is preserved for traceability and was not revalidated in this task.

Bounded outcome and review boundary#

Source: docs/proposals/audio-039-bound-device-reverb-fidelity.md in the project repository.