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.
| Member | Type | Description |
|---|---|---|
Id | Guid | Unique identifier. |
Name | string | Effect name. |
Enabled | bool | Enable/disable without removing from chain. |
Mix | float | Wet/dry mix (0.0 = dry only, 1.0 = wet only). |
IsReady | bool | Whether initialized and ready to process. |
Initialize(AudioConfig) | method | Called automatically when added to mixer or chain. |
Process(Span<float>, int) | method | Zero-allocation in-place processing. |
Reset() | method | Clear internal state (delay lines, filter history, etc.). |
ReverbEffect
Professional quality reverb based on an optimized extended Freeverb algorithm.
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.
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.
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.
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
| Class | Description |
|---|---|
ReverbEffect | Freeverb-based reverb with presets |
DelayEffect | Stereo delay with ping-pong and damping |
EqualizerEffect | 10-band parametric EQ |
Equalizer30BandEffect | 30-band graphic EQ |
CompressorEffect | Dynamic range compressor |
LimiterEffect | Soft/hard peak limiter |
ChorusEffect | Chorus / spatial thickening |
FlangerEffect | Flanging / sweeping comb filter |
PhaserEffect | Phase modulation |
DistortionEffect | Distortion / hard clipping |
OverdriveEffect | Overdrive / soft saturation |
AutoGainEffect | Automatic gain control (AGC) |
EnhancerEffect | Loudness enhancement / exciter |
DynamicAmpEffect | Dynamic range amplification |
RotaryEffect | Rotating 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.
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 stopsSmartMasterConfig
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.
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
// 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
| Property | Type | Description |
|---|---|---|
Name | string | Plugin name. |
Vendor | string | Plugin vendor/manufacturer. |
Version | string? | Plugin version string. |
IsEffect | bool | true for audio effect plugins. |
IsInstrument | bool | true for instrument plugins (not supported). |
HasEditor | bool | Whether the plugin has a graphical editor. |
IsEditorOpen | bool | Whether the editor window is currently open. |
IsReady | bool | Whether initialized and ready to process audio. |
PluginPath | string | Filesystem path to the .vst3 bundle. |
Call PauseDeviceMonitoring() before opening the VST3 editor window and ResumeDeviceMonitoring() after closing to prevent device enumeration interference.