Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
model.hpp File Reference
#include <pulp/runtime/result.hpp>
#include <pulp/timebase/compiled_meter_map.hpp>
#include <pulp/timebase/compiled_tempo_map.hpp>
#include <pulp/timebase/quantize.hpp>
#include <pulp/timebase/rational_time.hpp>
#include <pulp/timebase/tick.hpp>
#include <pulp/timeline/assets.hpp>
#include <pulp/timeline/automation_lane.hpp>
#include <pulp/timeline/clip.hpp>
#include <pulp/timeline/clip_launch.hpp>
#include <pulp/timeline/device_placement.hpp>
#include <pulp/timeline/item_id.hpp>
#include <pulp/timeline/modulation.hpp>
#include <pulp/timeline/note_modifier.hpp>
#include <pulp/timeline/recording.hpp>
#include <pulp/timeline/tuning.hpp>
#include <compare>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <type_traits>
#include <utility>
#include <variant>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::timeline::TrackIndexStats
 Diagnostic counters for persistent track clip-index allocation. More...
struct  pulp::timeline::LauncherIndexStats
 Diagnostic counters for persistent launcher-index allocation. More...
struct  pulp::timeline::TrackInput
 Complete input for constructing a Track and its owned collections. More...
class  pulp::timeline::Track
 Immutable identity-bearing arrangement track. More...
class  pulp::timeline::Track::ClipView
 Snapshot-owned random-access view of clips in timeline order. More...
class  pulp::timeline::Track::ClipView::Iterator
 Forward iterator that keeps the underlying persistent index alive. More...
struct  pulp::timeline::ChordScaleEvent
 Harmonic statement in force from position until the next event. More...
class  pulp::timeline::ChordScaleLane
 Immutable chord/scale context lane owned by a sequence. More...
struct  pulp::timeline::DynamicsEvent
 Intensity statement in force from position until the next event. More...
class  pulp::timeline::DynamicsLane
 Immutable intensity context lane owned by a sequence. More...
struct  pulp::timeline::SequenceMarker
 Named point on a sequence's musical timeline. More...
struct  pulp::timeline::SequenceRegion
 Named positive-duration span on a sequence's musical timeline. More...
struct  pulp::timeline::GrooveStep
 One timing offset and per-mille accent in a repeating groove table. More...
struct  pulp::timeline::GrooveTemplateInput
 Complete validated construction input for a GrooveTemplate. More...
class  pulp::timeline::GrooveTemplate
 Immutable sequence-owned swing, timing-offset, and accent context. More...
struct  pulp::timeline::SequenceInput
 Complete construction input for a Sequence and its owned collections. More...
class  pulp::timeline::Sequence
 Immutable identity-bearing arrangement with tracks, annotations, context, and launch scenes. More...
class  pulp::timeline::Sequence::SceneView
 Snapshot-owned random-access view preserving authored scene order. More...
class  pulp::timeline::Sequence::SceneView::Iterator
 Forward iterator that keeps the persistent launcher store alive. More...
struct  pulp::timeline::SessionStart
 Absolute source/house-clock position corresponding to project time zero. More...
struct  pulp::timeline::ProjectInput
 Complete input for constructing a Project and its identity domain. More...
struct  pulp::timeline::ItemLocation
 Canonical ownership and ancestor coordinates for one project identity. More...
struct  pulp::timeline::IdentityMutation
 Planned identity-index transition accompanying an immutable model edit. More...
struct  pulp::timeline::ProjectIdentityStats
 Diagnostic counters for persistent project identity-index allocation. More...
class  pulp::timeline::SequenceCompileStructureToken
 Opaque, process-local identity for the part of a Project snapshot that determines nested-sequence and registered-content compile subscribers. More...
class  pulp::timeline::Project
 Immutable root of a Timeline document and its monotonic identity domain. More...
class  pulp::timeline::IdRemapTable
 Canonically ordered mapping from source identities to remapped identities. More...
struct  pulp::timeline::ExternalIdFixup
 Optional non-throwing translation for an externally referenced identity. More...
struct  pulp::timeline::RemapIdFixups
 Independent external-reference fixups for media assets and sequences. More...
struct  pulp::timeline::RemappedClip
 Remapped clip snapshot and its complete owned-identity table. More...
struct  pulp::timeline::RemappedTrack
 Remapped track snapshot and its complete owned-identity table. More...
struct  pulp::timeline::RemappedSequence
 Remapped sequence snapshot and its complete owned-identity table. More...
struct  pulp::timeline::RemappedProject
 Remapped project snapshot and complete source-to-destination identity table. More...

Namespaces

namespace  pulp
namespace  pulp::timeline
namespace  pulp::timeline::detail

Enumerations

enum class  pulp::timeline::ChordQuality : std::uint8_t {
  pulp::timeline::ChordQuality::Major = 0 , pulp::timeline::ChordQuality::Minor = 1 , pulp::timeline::ChordQuality::Diminished = 2 , pulp::timeline::ChordQuality::Augmented = 3 ,
  pulp::timeline::ChordQuality::Dominant7 = 4 , pulp::timeline::ChordQuality::Major7 = 5 , pulp::timeline::ChordQuality::Minor7 = 6 , pulp::timeline::ChordQuality::HalfDiminished7 = 7 ,
  pulp::timeline::ChordQuality::Suspended2 = 8 , pulp::timeline::ChordQuality::Suspended4 = 9
}
 Harmonic quality of a chord statement. More...
enum class  pulp::timeline::ScaleMode : std::uint8_t {
  pulp::timeline::ScaleMode::Major = 0 , pulp::timeline::ScaleMode::NaturalMinor = 1 , pulp::timeline::ScaleMode::HarmonicMinor = 2 , pulp::timeline::ScaleMode::MelodicMinor = 3 ,
  pulp::timeline::ScaleMode::Dorian = 4 , pulp::timeline::ScaleMode::Phrygian = 5 , pulp::timeline::ScaleMode::Lydian = 6 , pulp::timeline::ScaleMode::Mixolydian = 7 ,
  pulp::timeline::ScaleMode::Locrian = 8 , pulp::timeline::ScaleMode::Chromatic = 9
}
 Scale mode associated with a harmonic context event. More...
enum  pulp::timeline::ChordExtension : std::uint16_t {
  pulp::timeline::kChordExtensionNinth = 1u << 0 , pulp::timeline::kChordExtensionFlatNinth = 1u << 1 , pulp::timeline::kChordExtensionSharpNinth = 1u << 2 , pulp::timeline::kChordExtensionEleventh = 1u << 3 ,
  pulp::timeline::kChordExtensionSharpEleventh = 1u << 4 , pulp::timeline::kChordExtensionThirteenth = 1u << 5 , pulp::timeline::kChordExtensionFlatThirteenth = 1u << 6
}
 Added scale degree a chord statement carries above its quality. More...
enum class  pulp::timeline::ChordVoicing : std::uint8_t {
  pulp::timeline::ChordVoicing::Close , pulp::timeline::ChordVoicing::Open , pulp::timeline::ChordVoicing::Drop2 , pulp::timeline::ChordVoicing::Drop3 ,
  pulp::timeline::ChordVoicing::Rootless , pulp::timeline::ChordVoicing::Shell
}
 Non-binding hint for how a generator should spread a chord's tones. More...
enum class  pulp::timeline::SectionRole : std::uint8_t {
  pulp::timeline::SectionRole::Unspecified , pulp::timeline::SectionRole::Intro , pulp::timeline::SectionRole::Verse , pulp::timeline::SectionRole::PreChorus ,
  pulp::timeline::SectionRole::Chorus , pulp::timeline::SectionRole::Bridge , pulp::timeline::SectionRole::Breakdown , pulp::timeline::SectionRole::Drop ,
  pulp::timeline::SectionRole::Solo , pulp::timeline::SectionRole::Interlude , pulp::timeline::SectionRole::Outro
}
 Structural part a region names, independent of what the region is called. More...
enum class  pulp::timeline::ItemKind : std::uint8_t {
  pulp::timeline::ItemKind::Project , pulp::timeline::ItemKind::Asset , pulp::timeline::ItemKind::Sequence , pulp::timeline::ItemKind::Track ,
  pulp::timeline::ItemKind::Clip , pulp::timeline::ItemKind::Note , pulp::timeline::ItemKind::MidiLane , pulp::timeline::ItemKind::MidiLanePoint ,
  pulp::timeline::ItemKind::DevicePlacement , pulp::timeline::ItemKind::AutomationLane , pulp::timeline::ItemKind::AutomationPoint , pulp::timeline::ItemKind::Modulator ,
  pulp::timeline::ItemKind::MacroControl , pulp::timeline::ItemKind::ModulationRoute , pulp::timeline::ItemKind::TakeLane , pulp::timeline::ItemKind::Take ,
  pulp::timeline::ItemKind::Marker , pulp::timeline::ItemKind::Region , pulp::timeline::ItemKind::Scene , pulp::timeline::ItemKind::Slot
}
 Kind of an identity-bearing item in a Project. More...
enum class  pulp::timeline::IdentityMutationKind : std::uint8_t { pulp::timeline::IdentityMutationKind::Insert , pulp::timeline::IdentityMutationKind::Deactivate , pulp::timeline::IdentityMutationKind::Reactivate }
 Allowed transition applied to one identity-index entry. More...

Functions

std::optional< ModelError > pulp::timeline::validate_sequence_graph (std::span< const Sequence > sequences)
 Validates all SequenceRef targets, cycles, and maximum graph depth.
std::optional< ModelError > pulp::timeline::validate_sequence_edge (std::span< const Sequence > sequences, ItemId parent_id, ItemId child_id)
 Validates one prospective parent-to-child edge against a sequence pool.
constexpr ItemId pulp::timeline::immediate_parent_id (ItemKind kind, ItemId project_id, ItemId sequence_id, ItemId track_id, ItemId clip_id, ItemId lane_id={}) noexcept
 Derives the canonical immediate owner from an item's kind and coordinates.
runtime::Result< RemappedClip, ModelError > pulp::timeline::remap_ids (const Clip &clip, ItemIdAllocator &allocator, ExternalIdFixup external={})
 Remaps a clip's owned identities, optionally translating asset references.
runtime::Result< RemappedClip, ModelError > pulp::timeline::remap_ids (const Clip &clip, ItemIdAllocator &allocator, RemapIdFixups fixups)
 Remaps a clip with independent asset and sequence reference fixups.
runtime::Result< RemappedTrack, ModelError > pulp::timeline::remap_ids (const Track &track, ItemIdAllocator &allocator, ExternalIdFixup external={})
 Remaps a track's owned subtree, optionally translating asset references.
runtime::Result< RemappedTrack, ModelError > pulp::timeline::remap_ids (const Track &track, ItemIdAllocator &allocator, RemapIdFixups fixups)
 Remaps a track with independent asset and sequence reference fixups.
runtime::Result< RemappedSequence, ModelError > pulp::timeline::remap_ids (const Sequence &sequence, ItemIdAllocator &allocator, ExternalIdFixup external={})
 Remaps a sequence's owned subtree, optionally translating asset references.
runtime::Result< RemappedSequence, ModelError > pulp::timeline::remap_ids (const Sequence &sequence, ItemIdAllocator &allocator, RemapIdFixups fixups)
 Remaps a sequence with independent asset and sequence reference fixups.
runtime::Result< RemappedSequence, ModelError > pulp::timeline::remap_ids (const Sequence &sequence, std::span< const std::pair< ItemId, ItemId > > carried_ids, RemapIdFixups fixups={})
 Rebuilds a sequence from an explicit carried identity table and reference fixups.
runtime::Result< RemappedProject, ModelError > pulp::timeline::remap_ids (const Project &project, std::uint64_t first_id)
 Remaps every project-owned identity starting at first_id.

Variables

constexpr std::uint16_t pulp::timeline::kChordExtensionMask
 Every extension bit the vocabulary defines; anything outside is rejected.
constexpr std::int32_t pulp::timeline::kGrooveUnitScale = 1000
 Per-mille identity scale for deterministic groove strengths and velocity.
constexpr std::int32_t pulp::timeline::kMaxGrooveVelocityScale = 4000
 Largest admitted per-step groove velocity multiplier, in per-mille.
constexpr std::size_t pulp::timeline::kMaxGrooveSteps = 1024
 Largest admitted number of entries in a repeating groove table.
constexpr std::size_t pulp::timeline::kMaxSequenceNestingDepth = 8
 Maximum admitted depth of an acyclic SequenceRef graph.