Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulpset.hpp File Reference

Timed command-script (.pulpset) replay over a HeadlessHost — a general, Magenta-agnostic offline render/replay harness (delivery item "G4"). More...

#include <pulp/format/headless.hpp>
#include <pulp/format/detail/locale_independent_float.hpp>
#include <pulp/audio/buffer.hpp>
#include <pulp/midi/buffer.hpp>
#include <pulp/midi/message.hpp>
#include <algorithm>
#include <charconv>
#include <cmath>
#include <cstdint>
#include <fstream>
#include <sstream>
#include <string>
#include <string_view>
#include <system_error>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::format::PulpsetEvent
 One timed steer in a .pulpset. More...
struct  pulp::format::Pulpset
 A parsed .pulpset — events sorted by sample offset. More...
struct  pulp::format::PulpsetRender
 Rendered stereo result of a replay. More...

Namespaces

namespace  pulp
namespace  pulp::format
 What the product grants a device: the quota table indexed by capability tier and live thermal state.

Functions

PulpsetRender pulp::format::render (HeadlessHost &host, const Pulpset &ps, std::size_t total_samples, std::size_t block_size=512)
 Replay ps over host for total_samples, in block_size blocks.
double pulp::format::segment_rms (const std::vector< float > &v, std::size_t a, std::size_t b)
 RMS of [a,b) of one channel — for range/property assertions.
bool pulp::format::write_wav_f32 (const std::string &path, const PulpsetRender &r, std::uint32_t sample_rate=48000)
 Write 32-bit float stereo WAV (offline render artifact).

Detailed Description

Timed command-script (.pulpset) replay over a HeadlessHost — a general, Magenta-agnostic offline render/replay harness (delivery item "G4").

A .pulpset is a timestamped stream of plugin steers — parameter changes and MIDI notes — keyed by absolute sample offset. render() drives a HeadlessHost block by block, applying each event when its sample window arrives, and returns the rendered stereo audio. Because the steers are data, the same script that an agent emits live (e.g. over MCP) can be replayed deterministically for a regression — render to a WAV and assert range/property invariants, or bit-exact for a non-generative plugin.

Script grammar (one event per line; # starts a comment): <sample> param <id> <value> — set parameter id to value <sample> note_on <pitch> [vel] — MIDI note-on (vel default 100, ch 0) <sample> note_off <pitch> — MIDI note-off

This sits on top of HeadlessHost; no audio device, no UI — CI-friendly.