Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 3.39 KB

README.md

File metadata and controls

76 lines (56 loc) · 3.39 KB

MVerb.Net

MVerb.Net is a faithful C# port of Martin Eastwood's MVerb stereo reverberator. It preserves the upstream single-precision arithmetic, delay geometry, control-rate updates, block-based smoothing, reset behavior, and sample-by-sample state progression.

The package targets .NET Standard 2.1, .NET 8, and .NET 10. Its parity suite processes 153,600 stereo frames across 12 native scenarios and compares 307,265 observations at their raw IEEE 754 binary32 representation. Managed output is bit-identical to the GCC reference for every observation. MSVC remains a separate native portability check because its long feedback trajectories dephase from GCC; it is not treated as a second managed parity oracle. See Parity verification and the compact MSVC portability report for the exact evidence and regeneration procedure.

Install

dotnet add package MVerb.Net --version 1.0.0

Use

using Reverb = MVerb.MVerb;

var reverb = new Reverb();
reverb.SetSampleRate(48_000f);
reverb.SetParameter(Reverb.Parameter.Decay, 0.7f);
reverb.SetParameter(Reverb.Parameter.Mix, 0.35f);

reverb.Process(inputLeft, inputRight, outputLeft, outputRight, inputLeft.Length);

MVerb's controls normally accept values from zero to one. They are intentionally not clamped because the native implementation does not clamp them. GetParameter also preserves the original display-oriented percentage scaling, including its transformed damping and size results.

The frame count supplied to Process must fit all four spans. Block boundaries are behaviorally significant: each call ramps control smoothing over that call's frame count, exactly like native MVerb. Per-channel input and output spans may alias for in-place processing.

Repository layout

  • src/MVerb.Net contains the package implementation.
  • src/MVerb.Net.Tests contains managed parity and contract tests plus the committed GCC fixture.
  • src/MVerb.Net.Demo is a minimal executable example.
  • reference/mverb is the exact upstream source revision used for verification.
  • tools/parity builds the native capture harness and regenerates fixtures.
  • tools/package validates and smoke-tests package artifacts.

Build and test

Visual Studio 2022 or newer can open MVerb.Net.sln directly. The command-line equivalent is:

dotnet build MVerb.Net.sln -c Release
dotnet test src/MVerb.Net.Tests/MVerb.Net.Tests.csproj -c Release -f net8.0 --no-build
dotnet test src/MVerb.Net.Tests/MVerb.Net.Tests.csproj -c Release -f net10.0 --no-build

Initialize the pinned upstream source before regenerating parity data:

git submodule update --init --recursive

On Windows, tools/parity/scripts/regenerate-parity.ps1 discovers Visual Studio for the transient MSVC portability profile and accepts an explicit g++.exe through -Compiler for GCC. Validate an MSVC capture with tools/parity/scripts/verify-msvc-portability.ps1. On Linux, use tools/parity/scripts/regenerate-parity.sh for the GCC parity fixture.

Attribution and license

MVerb.Net is a derivative of GPL-3.0-or-later code and is distributed under the same terms; see LICENSE. Upstream attribution and the matching license copy are preserved in THIRD_PARTY_NOTICES.md and LICENSES/mverb-GPL-3.0-or-later.txt.