Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::dataplane Namespace Reference

Namespaces

namespace  detail

Classes

struct  MeterData
struct  MeterBallistics
class  AudioBridge
class  StateStoreHostParamSurface
 The native (Pulp Processor::create_view()) backing for HostParamSurface, implemented over a StateStore. More...
class  HostParamSurface
 A framework-agnostic, native-view-facing runtime parameter accessor. More...
class  HostActionSurface
 A framework-agnostic host command channel. More...
class  ValueChannelSet
 A processor's declared channels. More...
struct  ValueChannelInfo
 What a channel is, for discovery and for a UI lint to check names against. More...
struct  ValueChannelTelemetrySnapshot
 A coherent continuous payload copied by the existing UI reader path. More...
struct  ValueChannelTelemetryEventBatch
 One producer event batch retained by the ordered telemetry tap. More...
struct  ValueChannelTelemetryEventStats
 Current producer-tap state. Overflow is cumulative for the source lifetime. More...
struct  ValueChannelTelemetryDescriptor
 Stable metadata for a channel held by a telemetry attachment. More...
class  ValueChannelTelemetryAttachment
 Exclusive reader attachment for every telemetry sidecar in one channel set. More...
struct  MeterFrame
 A single multi-channel meter reading. More...
class  PublishCounter
 Monotonic publish counter, shared by every value source. More...
class  MeterSource
 Lock-free meter channel: the host publishes a MeterFrame from the audio/host thread; the view reads the latest frame paint-safe. More...
struct  VectorFrame
 A block of samples for a scope-style display — an envelope curve, a detector's output, a window of the signal a processor is actually working on. More...
struct  ValueEvent
 One occurrence inside an audio block. More...
struct  EventFrame
 A bounded list of occurrences from one audio block. More...
class  VectorSource
 Lock-free vector channel: the writer publishes a block of samples, the view reads the latest block paint-safe. More...
class  EventSource
 Lock-free event channel: the writer publishes the occurrences from one audio block and the view reads the latest completed block. More...
class  ScalarSource
 Lock-free scalar channel: a single paint-safe cached number (a readout value, a modulation ring's base→modulated position). More...
struct  VisualizationBenchSink
 Where the bridge reports its benchmark timings. More...
struct  SpectrumData
 Published one-sided amplitude spectrum (lock-free via TripleBuffer). More...
struct  WaveformData
 Published waveform capture (latest buffer snapshot). More...
struct  VisualizationConfig
 Configuration for the visualization bridge. More...
class  VisualizationBridge
 Central visualization bridge: a fixed multichannel audio tap plus a caller-driven, non-RT analyzer and lock-free latest-value publication. More...

Typedefs

using ValueChannelVisitor = std::function<void(ValueChannelSet*)>
 Runs a value-channel operation while the hosting processor guarantees that the exposed set and all of its sources remain alive.
using ValueChannelAccess = std::function<void(const ValueChannelVisitor&)>
using ValueChannelContinuousPayload = std::variant<float, MeterFrame, VectorFrame>

Enumerations

enum class  ValueChannelShape { scalar , meter , vector , events }
 The shape of a channel's payload. More...
enum class  VisualizationBacklogPolicy { in_order , latest_window }
 How poll() treats captured audio it has not analyzed yet. More...

Functions

double param_index_to_normalized (int index, int step_count)
 Map a discrete parameter's value index to a normalized [0, 1] value.
int param_normalized_to_index (double normalized, int step_count)
 Inverse of param_index_to_normalized: the nearest value index for a normalized [0, 1] value.
const char * value_channel_shape_name (ValueChannelShape shape) noexcept
 Stable wire name for a channel's shape.
choc::value::Value value_channel_to_value (const ValueChannelInfo &info)
 One channel as {name, unit, shape, neutral}.
choc::value::Value value_channels_to_value (const ValueChannelSet *channels)
 Every declared channel, in declaration order.
choc::value::Value value_channels_to_value (std::span< const ValueChannelInfo > channels)
 Serialize an owned metadata snapshot.

Typedef Documentation

◆ ValueChannelAccess

using pulp::dataplane::ValueChannelAccess = std::function<void(const ValueChannelVisitor&)>

◆ ValueChannelContinuousPayload

◆ ValueChannelVisitor

Runs a value-channel operation while the hosting processor guarantees that the exposed set and all of its sources remain alive.

Callers must not retain either the set or a source obtained from it after the visitor returns.

Enumeration Type Documentation

◆ ValueChannelShape

The shape of a channel's payload.

Enumerator
scalar 

one number per publish (gain reduction, envelope level)

meter 

a multi-channel MeterFrame (peak/RMS per channel)

vector 

a block of samples for a scope-style display

events 

a per-block list of ValueEvent occurrences

◆ VisualizationBacklogPolicy

How poll() treats captured audio it has not analyzed yet.

Enumerator
in_order 

Analyze every captured frame in order, at most max_frames_per_poll per call.

A consumer that polls slower than audio arrives accumulates a backlog; once the capture buffer overflows, blocks are dropped, the next poll resets the analysis, and nothing is published until a full fft_size of new audio arrives.

latest_window 

Display-oriented: every poll consumes the whole backlog, treating max_frames_per_poll as unbounded, so the published spectrum trails the newest captured sample by less than one hop.

When the backlog exceeds one analysis window (max(fft_size, waveform_length)), the stale frames are discarded and the STFT restarts on the newest window, which costs one FFT per channel and publishes immediately. A skip is intentional: it is not counted in dropped_frames and does not change the epoch. Draining every poll also keeps the capture buffer from overflowing unless a single poll gap exceeds its capacity.

Function Documentation

◆ param_index_to_normalized()

double pulp::dataplane::param_index_to_normalized ( int index,
int step_count )
inline

Map a discrete parameter's value index to a normalized [0, 1] value.

The denominator is step_count - 1, not step_count: with N values, index 0 maps to 0.0 and index N-1 maps to 1.0, so the top index reaches the top of the host's automation range. This is the same convention state::ParamRange::normalize() produces for an evenly-spaced discrete range, and the one every format adapter round-trips against.

Evenly-spaced is the assumption, and it is why this takes a bare count: a host surface may have no ParamRange behind it at all (an embedded framework's parameter tree reaches this surface over a C ABI). A discrete parameter whose ParamRange declares a skew is therefore OUT of this helper's contract — the range's own curve, not this line, defines its normalized values, and the two disagree. Declare discrete parameters with a linear range (ParamRange::is_linear()); reach for range.normalize() directly if one genuinely must be shaped.

Parameters
step_counta HostParamSurface::param_step_count() result. 0 (the continuous/unknown signal) and 1 (a single-value parameter) both have no index domain and yield 0.0 — this is the guard that keeps the 0 contract from becoming a division by zero at a call site.

◆ param_normalized_to_index()

int pulp::dataplane::param_normalized_to_index ( double normalized,
int step_count )
inline

Inverse of param_index_to_normalized: the nearest value index for a normalized [0, 1] value.

Rounds to nearest so a value landing between two indices snaps to the closer one. Yields 0 when step_count carries no index domain (0 or 1).

◆ value_channel_shape_name()

const char * pulp::dataplane::value_channel_shape_name ( ValueChannelShape shape)
noexcept

Stable wire name for a channel's shape.

Spelled out per case rather than derived from the enum's order, so landing the reserved events shape cannot renumber what a UI or a lint already matches on.

◆ value_channel_to_value()

choc::value::Value pulp::dataplane::value_channel_to_value ( const ValueChannelInfo & info)

One channel as {name, unit, shape, neutral}.

◆ value_channels_to_value() [1/2]

choc::value::Value pulp::dataplane::value_channels_to_value ( const ValueChannelSet * channels)

Every declared channel, in declaration order.

A null set yields an EMPTY ARRAY, never undefined: no channels is the default every processor inherits, so iterating the result must be safe without a guard.

◆ value_channels_to_value() [2/2]

choc::value::Value pulp::dataplane::value_channels_to_value ( std::span< const ValueChannelInfo > channels)

Serialize an owned metadata snapshot.

Inspector hosts use this overload so a hot-swappable processor cannot leave a retained raw ValueChannelSet pointer behind after its logic instance is reclaimed.