Table of Contents

Interface ITempoMap

Namespace
NAudio.Sequencing
Assembly
NAudio.Core.dll

Maps musical position (in canonical ticks) to and from real time (in seconds). Implementations may be immutable (a static curve built from a MIDI file) or mutable (a live tempo knob that changes the future from now forward).

public interface ITempoMap

Methods

BpmAtTicks(long)

The tempo in BPM in force at the given tick.

double BpmAtTicks(long ticks)

Parameters

ticks long

Returns

double

NextChangeAfter(long)

The tick at which the next tempo change occurs after tick, or null if no further change is recorded (for a live map, no further change has been scheduled yet).

long? NextChangeAfter(long tick)

Parameters

tick long

Returns

long?

Remarks

Consumers that need a single tempo per process block (e.g. a VST3 host populating ProcessContext.tempo) use this to decide whether to split a block at the tempo-change boundary or to use the start-of-block tempo and accept the inaccuracy.

SecondsFromTicks(long)

The real time in seconds at which the given tick falls.

double SecondsFromTicks(long ticks)

Parameters

ticks long

Returns

double

TicksFromSeconds(double)

The tick at which the given real time falls.

long TicksFromSeconds(double seconds)

Parameters

seconds double

Returns

long