Tabula Sonora 0.1.0
A native C++20 implementation of the Roland Sound Canvas VA synth voice
Loading...
Searching...
No Matches
ts::ControllerTimeline Class Reference

A controller's value over time, as breakpoints. More...

#include <tabulasonora/sequence.hpp>

Public Member Functions

void add (std::int64_t position, int value)
 Records a change.
int value_at (std::int64_t position, int fallback) const noexcept
 The value in force at a position, or fallback before the first breakpoint.
std::size_t size () const noexcept
 Number of recorded changes.
bool fill (std::int64_t start, std::span< int > destination, int fallback) const noexcept
 Fills a span with this controller's value at every sample from a starting position.

Detailed Description

A controller's value over time, as breakpoints.

Zero-order hold: a value applies from its position until the next breakpoint. Note parameters are latched at note-on, so what matters is the value in force at that instant.

Member Function Documentation

◆ add()

void ts::ControllerTimeline::add ( std::int64_t position,
int value )
inline

Records a change.

◆ value_at()

int ts::ControllerTimeline::value_at ( std::int64_t position,
int fallback ) const
nodiscardnoexcept

The value in force at a position, or fallback before the first breakpoint.

◆ size()

std::size_t ts::ControllerTimeline::size ( ) const
inlinenodiscardnoexcept

Number of recorded changes.

◆ fill()

bool ts::ControllerTimeline::fill ( std::int64_t start,
std::span< int > destination,
int fallback ) const
noexcept

Fills a span with this controller's value at every sample from a starting position.

Returns whether the value changed at any point within the span. Walks the breakpoints once rather than searching per sample. Sampling at control-tick resolution instead would be ten times too coarse: events land on the 32-sample render grid, which is the granularity the engine applies them at.


The documentation for this class was generated from the following file: