Table of Contents

Struct Vst3MusicalContext

Namespace
NAudio.Vst3
Assembly
NAudio.Vst3.dll

A per-block snapshot of musical/transport state for a hosted instrument's ProcessContext — tempo, time signature, musical position and whether the transport is playing. Pushed to a Vst3Plugin via SetMusicalContext(in Vst3MusicalContext) before each Process(ReadOnlySpan<float>, Span<float>, int) call so tempo-following plug-ins (arpeggiators, tempo-synced delays, LFOs) lock to the host timeline. Vst3MidiInstrument builds one of these from the sequencer's Transport / ITempoMap / TimeSignatureMap; advanced callers driving Vst3Plugin directly can populate it themselves.

public readonly record struct Vst3MusicalContext : IEquatable<Vst3MusicalContext>
Implements
Inherited Members

Constructors

Vst3MusicalContext(bool, long, double, double, double, int, int)

A per-block snapshot of musical/transport state for a hosted instrument's ProcessContext — tempo, time signature, musical position and whether the transport is playing. Pushed to a Vst3Plugin via SetMusicalContext(in Vst3MusicalContext) before each Process(ReadOnlySpan<float>, Span<float>, int) call so tempo-following plug-ins (arpeggiators, tempo-synced delays, LFOs) lock to the host timeline. Vst3MidiInstrument builds one of these from the sequencer's Transport / ITempoMap / TimeSignatureMap; advanced callers driving Vst3Plugin directly can populate it themselves.

public Vst3MusicalContext(bool IsPlaying, long ProjectTimeSamples, double ProjectTimeMusic, double BarPositionMusic, double Tempo, int TimeSigNumerator, int TimeSigDenominator)

Parameters

IsPlaying bool

Whether the transport is running (sets the VST 3 kPlaying state flag).

ProjectTimeSamples long

Playhead position in samples (project + continuous time).

ProjectTimeMusic double

Playhead position in quarter notes.

BarPositionMusic double

The current bar's start position in quarter notes.

Tempo double

Tempo in BPM at the playhead.

TimeSigNumerator int

Time-signature numerator (beats per bar).

TimeSigDenominator int

Time-signature denominator (note value of a beat).

Properties

BarPositionMusic

The current bar's start position in quarter notes.

public double BarPositionMusic { get; init; }

Property Value

double

IsPlaying

Whether the transport is running (sets the VST 3 kPlaying state flag).

public bool IsPlaying { get; init; }

Property Value

bool

ProjectTimeMusic

Playhead position in quarter notes.

public double ProjectTimeMusic { get; init; }

Property Value

double

ProjectTimeSamples

Playhead position in samples (project + continuous time).

public long ProjectTimeSamples { get; init; }

Property Value

long

Tempo

Tempo in BPM at the playhead.

public double Tempo { get; init; }

Property Value

double

TimeSigDenominator

Time-signature denominator (note value of a beat).

public int TimeSigDenominator { get; init; }

Property Value

int

TimeSigNumerator

Time-signature numerator (beats per bar).

public int TimeSigNumerator { get; init; }

Property Value

int