Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
Compilation and extensions

Compile-time context contracts and extension preparation. More...

Classes

class  pulp::timeline::CompileContextSubscriptions
 The declared set of context kinds one content renderer reads. More...
class  pulp::timeline::CompileContextView
 The read side of the contract: a read-only window onto one pinned snapshot's context, narrowed to what its owner declared. More...
struct  pulp::timeline::NoteTransformCallbackFailure
 Failure returned directly by a registered note-transform callback. More...
struct  pulp::timeline::NoteTransformRegistration
 Immutable registration for one versioned transform implementation. More...
struct  pulp::timeline::NoteTransformError
 Transform failure with nested callback, persistence, model, or transaction detail. More...
struct  pulp::timeline::ApplyNoteTransform
 A typed, apply-time request. More...
struct  pulp::timeline::NoteTransformPreview
 Prepared durable transaction and resulting immutable document snapshot. More...
class  pulp::timeline::NoteTransformRegistry
 Control-thread registry for pure note transforms. More...

Typedefs

using pulp::timeline::NoteTransformFunction
 Pure, non-throwing note-transform callback.

Enumerations

enum class  pulp::timeline::CompileContextKind : std::uint8_t {
  pulp::timeline::CompileContextKind::ChordScale , pulp::timeline::CompileContextKind::Groove , pulp::timeline::CompileContextKind::Dynamics , pulp::timeline::CompileContextKind::CrossTrackRhythm ,
  pulp::timeline::CompileContextKind::EnsembleSkeleton
}
 A kind of timeline context a renderer's compile hook may read beyond its own clip's content. More...
enum class  pulp::timeline::NoteTransformCallbackError : std::uint8_t { pulp::timeline::NoteTransformCallbackError::InvalidParameters , pulp::timeline::NoteTransformCallbackError::Refused }
 Extension callback failures that are safe to persist in transform diagnostics. More...
enum class  pulp::timeline::NoteTransformErrorCode : std::uint8_t {
  pulp::timeline::NoteTransformErrorCode::InvalidRegistration , pulp::timeline::NoteTransformErrorCode::DuplicateRegistration , pulp::timeline::NoteTransformErrorCode::CapacityExceeded , pulp::timeline::NoteTransformErrorCode::TransformNotFound ,
  pulp::timeline::NoteTransformErrorCode::InvalidView , pulp::timeline::NoteTransformErrorCode::InvalidParameters , pulp::timeline::NoteTransformErrorCode::TargetMissing , pulp::timeline::NoteTransformErrorCode::WrongTargetKind ,
  pulp::timeline::NoteTransformErrorCode::CallbackFailed , pulp::timeline::NoteTransformErrorCode::InvalidOutput , pulp::timeline::NoteTransformErrorCode::ForeignOutputIdentity , pulp::timeline::NoteTransformErrorCode::DuplicateOutputIdentity ,
  pulp::timeline::NoteTransformErrorCode::OutputLimitExceeded , pulp::timeline::NoteTransformErrorCode::ItemIdExhausted , pulp::timeline::NoteTransformErrorCode::TransactionRejected
}
 Validation and execution failures reported by NoteTransformRegistry. More...

Variables

constexpr std::size_t pulp::timeline::kCompileContextKindCount = 5
 Number of CompileContextKind values represented by the subscription bitset.

Detailed Description

Compile-time context contracts and extension preparation.

Typedef Documentation

◆ NoteTransformFunction

Initial value:
std::span<const NoteEvent> notes, std::string_view canonical_params_json,
std::uint64_t seed, const void* user_data) noexcept
Result<T, E> — either holds a T or an E, never both.
Definition result.hpp:76
Failure returned directly by a registered note-transform callback.
Definition note_transform.hpp:28

Pure, non-throwing note-transform callback.

The input span and parameter view are borrowed for the call. The callback returns a complete replacement note array and must not retain either view. user_data is the registration-owned object pointer.

Enumeration Type Documentation

◆ CompileContextKind

enum class pulp::timeline::CompileContextKind : std::uint8_t
strong

A kind of timeline context a renderer's compile hook may read beyond its own clip's content.

This enum is the vocabulary of the compile-context subscription contract. The contract exists because the compiler's dirty set is exact, not diffed: a committed transaction says precisely which items changed, and the compiler recompiles only their owners. A renderer that reads a sequence-owned lane while compiling breaks that reasoning — its clip did not change, so nothing would recompile it, and it would render stale harmony forever.

The contract closes the hole from both ends:

  • a renderer declares the context kinds it reads at registration, and the compiler keeps a reverse index from kind to declared readers, so a lane edit dirties exactly them and nothing else;
  • the read side is a CompileContextView carrying the same declaration, so an undeclared kind reads as absent. A hook cannot silently depend on context the compiler does not know to invalidate it for.

Adding a kind is a data change here plus a reverse-index case in the compiler; it is never a reason for a consumer to widen an invalidation. The reserved kinds below carry a constraint the first two do not. ChordScale and Groove are read from a sequence the reader already sits under, so the compile order is a tree walk. Dynamics, CrossTrackRhythm, and EnsembleSkeleton are peer-edge kinds: a reader can subscribe to context produced by a sibling track rather than an ancestor. That makes the compile order a DAG, and the DAG must stay acyclic — two tracks that each read the other's context have no valid order and would either deadlock a compile or silently resolve against a stale peer. Whoever gives one of these kinds a producer owns proving the acyclicity, because the bitset here cannot express it: subscription records what a reader reads, never when it may be compiled.

Enumerator
ChordScale 
Groove 
Dynamics 

Sequence-owned intensity.

Authored through the dynamics-lane command and readable here by a subscriber; no built-in compiler consumes it, so a reader that declares it decides what intensity means for its own output.

CrossTrackRhythm 

Reserved, peer-edge. See the acyclicity note above.

EnsembleSkeleton 

Reserved, peer-edge. See the acyclicity note above.

◆ NoteTransformCallbackError

enum class pulp::timeline::NoteTransformCallbackError : std::uint8_t
strong

Extension callback failures that are safe to persist in transform diagnostics.

Enumerator
InvalidParameters 
Refused 

◆ NoteTransformErrorCode

enum class pulp::timeline::NoteTransformErrorCode : std::uint8_t
strong

Validation and execution failures reported by NoteTransformRegistry.

Enumerator
InvalidRegistration 
DuplicateRegistration 
CapacityExceeded 
TransformNotFound 
InvalidView 
InvalidParameters 
TargetMissing 
WrongTargetKind 
CallbackFailed 
InvalidOutput 
ForeignOutputIdentity 
DuplicateOutputIdentity 
OutputLimitExceeded 
ItemIdExhausted 
TransactionRejected 

Variable Documentation

◆ kCompileContextKindCount

std::size_t pulp::timeline::kCompileContextKindCount = 5
inlineconstexpr

Number of CompileContextKind values represented by the subscription bitset.