Effects & VST3

Zero-allocation built-in DSP effects, SmartMaster, and VST3 plugin hosting. Namespace: OwnaudioNET.Effects

IEffectProcessor Interface

All effects implement IEffectProcessor. Add them to mixer master chain or to a SourceWithEffects per-track chain.

MemberTypeDescription
IdGuidUnique identifier.
NamestringEffect name.
EnabledboolEnable/disable without removing from chain.
MixfloatWet/dry mix (0.0 = dry only, 1.0 = wet only).
IsReadyboolWhether initialized and ready to process.
Initialize(AudioConfig)methodCalled automatically when added to mixer or chain.
Process(Span<float>, int)methodZero-allocation in-place processing.
Reset()methodClear internal state (delay lines, filter history, etc.).

ReverbEffect

Professional quality reverb based on an optimized extended Freeverb algorithm.

C#
var reverb = new ReverbEffect
{
    RoomSize   = 0.7f,  // 0.0–1.0 (larger = longer tail)
    Damping    = 0.5f,  // 0.0–1.0 (higher = darker)
    Mix        = 0.3f,  // 0.0–1.0 wet/dry
    Width      = 1.0f,  // 0.0–1.0 stereo spread
    Gain       = 1.0f,  // input gain
    PreDelayMs = 20     // 0–500ms pre-delay
};

// Or use a preset
reverb.SetPreset(ReverbPreset.LargeHall);

Presets: Default, SmallRoom, LargeHall, Cathedral, Plate, Spring, AmbientPad, VocalBooth, DrumRoom, Gated, Subtle

DelayEffect

Stereo delay with ping-pong mode and feedback damping.

C#
var delay = new DelayEffect
{
    Time     = 375,    // ms (1–5000)
    Repeat   = 0.4f,   // feedback 0.0–1.0
    Damping  = 0.3f,   // high-freq damping 0.0–1.0
    Mix      = 0.3f,
    PingPong = true    // stereo ping-pong
};
delay.SetPreset(DelayPreset.PingPong);

Presets: Default, SlapBack, ClassicEcho, Ambient, Rhythmic, PingPong, TapeEcho, Dub, Thickening

EqualizerEffect

10-band parametric EQ. Bands: 31.25 Hz, 62.5 Hz, 125 Hz, 250 Hz, 500 Hz, 1 kHz, 2 kHz, 4 kHz, 8 kHz, 16 kHz.

C#
var eq = new EqualizerEffect();
eq.SetBandGain(0, +6.0f);   // boost 31Hz by 6dB
eq.SetBandGain(9, -3.0f);   // cut 16kHz by 3dB
float g = eq.GetBandGain(4); // query 500Hz band

eq.SetPreset(EqualizerPreset.Rock);

Presets: Default, Bass, Treble, Rock, Classical, Pop, Jazz, Voice

CompressorEffect

Professional dynamic range compressor with makeup gain.

C#
var comp = new CompressorEffect
{
    Threshold     = 0.7f,   // 0.0–1.0 linear amplitude
    Ratio         = 4.0f,   // 1.0–100.0 (N:1)
    AttackTimeMs  = 10f,    // 0.1–1000ms
    ReleaseTimeMs = 100f,   // 1–2000ms
    MakeupGain    = 1.2f    // linear amplitude multiplier
};
comp.SetPreset(CompressorPreset.VocalGentle);

Presets: Default, VocalGentle, VocalAggressive, Drums, Bass, MasteringLimiter, Vintage

All Built-in Effects

ClassDescription
ReverbEffectFreeverb-based reverb with presets
DelayEffectStereo delay with ping-pong and damping
EqualizerEffect10-band parametric EQ
Equalizer30BandEffect30-band graphic EQ
CompressorEffectDynamic range compressor
LimiterEffectSoft/hard peak limiter
ChorusEffectChorus / spatial thickening
FlangerEffectFlanging / sweeping comb filter
PhaserEffectPhase modulation
DistortionEffectDistortion / hard clipping
OverdriveEffectOverdrive / soft saturation
AutoGainEffectAutomatic gain control (AGC)
EnhancerEffectLoudness enhancement / exciter
DynamicAmpEffectDynamic range amplification
RotaryEffectRotating speaker simulation (Leslie)

SmartMaster Effect

Intelligent adaptive mastering chain for the master bus. Includes 31-band EQ, compressor, subharmonic synthesizer, and auto-calibration via room measurement.

C#
var smartMaster = new SmartMasterEffect();
mixer.AddMasterEffect(smartMaster);

// Factory preset by speaker type
smartMaster.LoadSpeakerPreset(SpeakerType.StudioMonitor);
// Other types: PA, Headphones, Car, HomeTheater, TV, Laptop

// Save / load user presets
smartMaster.Save("my-studio");
smartMaster.Load("my-studio");

// Reset to defaults
smartMaster.ResetToDefaults();

// Auto room measurement
await smartMaster.StartMeasurementAsync(); // plays test signal, auto-calibrates EQ
smartMaster.CancelMeasurement();
MeasurementStatusInfo status = smartMaster.GetMeasurementStatus();

// Lifecycle
smartMaster.OnPlaybackStopped(); // call when transport stops

SmartMasterConfig

C#
var config = new SmartMasterConfig
{
    GraphicEQGains       = new float[31],  // per-band dB gains (0 = flat)
    CompressorEnabled    = true,
    CompressorThreshold  = 0.5f,           // 0.0–1.0 linear
    CompressorRatio      = 4.0f,           // 4:1
    CompressorAttack     = 10f,            // ms
    CompressorRelease    = 100f,           // ms
    SubharmonicEnabled   = false,
    SubharmonicMix       = 0.0f,           // 0.0–1.0
    SubharmonicFreqRange = 60.0f           // max frequency in Hz
};

VST3 Plugin Hosting

Load and host VST3 audio effect plugins as IEffectProcessor instances. Instruments are not supported — effects only.

C#
using OwnaudioNET.Effects;

// Discover plugins
List<string>         paths = VST3PluginHost.FindPlugins();
List<VST3PluginInfo> info  = VST3PluginHost.ScanPluginsQuick();

// Load plugin
VST3PluginHost host = await VST3PluginHost.CreateAsync("/path/plugin.vst3");

if (!host.IsEffect) { host.Dispose(); return; } // reject instruments

// Initialize audio processing
int sampleRate = OwnaudioNet.Engine!.Config.SampleRate;
bool ready     = await host.InitializeAudioAsync(sampleRate, maxBlockSize: 1024);

// Add to mixer or track effect chain
mixer.AddMasterEffect(host.GetProcessor());
// or: trackFx.AddEffect(host.GetProcessor());

// Plugin UI
host.OpenEditor();
await host.OpenEditorAsync();
host.CloseEditor();
var size = await host.GetEditorSizeAsync();

Parameters & State

C#
// Read parameters
VST3ParameterInfo[] params = await host.GetParametersAsync();
int    count = await host.GetParameterCountAsync();
double value = await host.GetParameterAsync(paramId);

// Set parameters
host.SetParameter(paramId, 0.5);
await host.SetParametersAsync(new Dictionary<int, double> { { paramId, 0.75 } });

// Preset state (for project save/load)
byte[]? state = await host.GetStateAsync();
await host.SetStateAsync(state);

// Cleanup
await host.DisposeAsync();
// or:
host.Dispose();

VST3PluginHost Properties

PropertyTypeDescription
NamestringPlugin name.
VendorstringPlugin vendor/manufacturer.
Versionstring?Plugin version string.
IsEffectbooltrue for audio effect plugins.
IsInstrumentbooltrue for instrument plugins (not supported).
HasEditorboolWhether the plugin has a graphical editor.
IsEditorOpenboolWhether the editor window is currently open.
IsReadyboolWhether initialized and ready to process audio.
PluginPathstringFilesystem path to the .vst3 bundle.
⚠️

Call PauseDeviceMonitoring() before opening the VST3 editor window and ResumeDeviceMonitoring() after closing to prevent device enumeration interference.