Table of Contents

Class CorrelationMeter

Namespace
PluginUI
Assembly
PluginUI.dll

Phase correlation meter: a horizontal bar from −1 (out of phase) through 0 to +1 (mono), computed from two AudioRingBuffer over WindowMilliseconds and smoothed. Red on the left half warns that the mix will lose content when summed to mono.

public class CorrelationMeter : Control
Inheritance
CorrelationMeter
Inherited Members

Constructors

CorrelationMeter()

Creates a correlation meter.

public CorrelationMeter()

Properties

Correlation

Current (smoothed) correlation in [−1, 1].

[Browsable(false)]
public double Correlation { get; }

Property Value

double

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

LeftSource

Left channel samples.

[Browsable(false)]
public AudioRingBuffer? LeftSource { get; set; }

Property Value

AudioRingBuffer

RightSource

Right channel samples.

[Browsable(false)]
public AudioRingBuffer? RightSource { get; set; }

Property Value

AudioRingBuffer

SampleRate

Sample rate of the sources, used to convert the window to samples.

public float SampleRate { get; set; }

Property Value

float

SmoothingSeconds

Smoothing time constant in seconds (0 = none).

public float SmoothingSeconds { get; set; }

Property Value

float

WindowMilliseconds

Analysis window in milliseconds.

public float WindowMilliseconds { get; set; }

Property Value

float

Methods

OnAttached()

Called when the element joins a host (subscribe to external events here).

protected override void OnAttached()

OnDetached()

Called when the element leaves its host (unsubscribe here).

protected override void OnDetached()

RenderVector(DrawingContext, Rect, VectorStyle)

Vector rendering of the widget area.

protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)

Parameters

dc DrawingContext
widget Rect
style VectorStyle

Update(double)

Recomputes the correlation from the sources (called every frame).

public void Update(double elapsedSeconds)

Parameters

elapsedSeconds double

Time since the previous update.