Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::playback::EventCompensationShift Struct Reference

One event-injection point's prepared scheduling shift, counted in samples at the program's compiled sample rate. More...

#include <event_compensation.hpp>

Public Member Functions

constexpr bool compensating () const noexcept
constexpr bool operator== (const EventCompensationShift &) const noexcept=default

Public Attributes

std::int64_t samples = 0

Detailed Description

One event-injection point's prepared scheduling shift, counted in samples at the program's compiled sample rate.

Compensation shifts the SCHEDULING WINDOW; it never rewrites event data. PlaybackProgram is immutable and shared by the offline and realtime paths, and NoteProgramEvent::sample is authoritative against the exact CompiledTempoMap the program was compiled with. Folding a host-derived latency into that field would make the program a function of the host graph as well as the document, and would force a full recompile on every device swap. Reading the stream from origin + shift instead leaves the program untouched: the downstream chain delays the events back into place, so they land on the sample the document authored.

Samples, never ticks. A device's latency is a property of its buffering, not of the music, so a tempo ramp must not change it. Expressing the shift in ticks would shrink it as tempo rises, which is the reason timeline::ProductionDeclaration's lookahead is barred from reaching a delay-compensation computation in the first place.

Member Function Documentation

◆ compensating()

bool pulp::playback::EventCompensationShift::compensating ( ) const
inlineconstexprnoexcept

◆ operator==()

bool pulp::playback::EventCompensationShift::operator== ( const EventCompensationShift & ) const
constexprdefaultnoexcept

Member Data Documentation

◆ samples

std::int64_t pulp::playback::EventCompensationShift::samples = 0

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