Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
signal_graph_connection.hpp
Go to the documentation of this file.
1#pragma once
2
3// Connection vocabulary for the Pulp host signal graph.
4
6
7#include <cstdint>
8
9namespace pulp::host {
10
11// ── Connection ──────────────────────────────────────────────────────────
12
13enum class AutomationMix : uint8_t {
14 Replace = 0, // default; graph refuses a 2nd Replace edge to same (node,param)
15 Add = 1, // summed with other Add edges, clamped to param range
16};
17
18struct Connection {
22 PortIndex dest_port; // audio: dest port index; automation: ignored
23 bool feedback = false; // back-edge: reads previous block's audio, breaks
24 // the cycle for topological sort and PDC.
25 bool midi = false; // event-edge: routes MidiBuffer events instead of
26 // audio samples. Ports are ignored.
27 bool automation = false; // automation-edge: source audio drives a param on
28 // the dest plugin.
29 bool audio_rate_modulation = false; // dense CV edge into an AudioRate param.
30 bool sidechain = false; // sidechain-edge: like a normal audio edge, but
31 // routes into one of the destination plugin's
32 // sidechain-bus input ports. The
33 // topological-sort + PDC treat sidechain as a
34 // hard edge — it is not a back-edge.
35
36 // Parameter-modulation fields (valid when automation or
37 // audio_rate_modulation is true).
38 uint32_t automation_param_id = 0;
39 float automation_range_lo = 0.0f; // plain param domain
40 float automation_range_hi = 1.0f; // plain param domain
41 float automation_smoothing_ms = 0.0f; // per-source pre-mix slew
43 bool spectral = false;
44
45 bool operator==(const Connection& o) const {
46 return source_node == o.source_node && source_port == o.source_port &&
47 dest_node == o.dest_node && dest_port == o.dest_port && automation == o.automation &&
48 audio_rate_modulation == o.audio_rate_modulation && sidechain == o.sidechain &&
49 spectral == o.spectral &&
50 ((automation || audio_rate_modulation) ? automation_param_id == o.automation_param_id
51 : true);
52 }
53};
54
55} // namespace pulp::host
std::uint32_t NodeId
Definition graph_types.hpp:7
std::uint32_t PortIndex
Definition graph_types.hpp:8
Bounded event contracts shared by host ingress and graph-authored nodes.
Definition anticipation_eligibility.hpp:9
AutomationMix
Definition signal_graph_connection.hpp:13
@ Replace
Definition signal_graph_connection.hpp:14
@ Add
Definition signal_graph_connection.hpp:15
Definition signal_graph_connection.hpp:18
bool operator==(const Connection &o) const
Definition signal_graph_connection.hpp:45
NodeId dest_node
Definition signal_graph_connection.hpp:21
bool feedback
Definition signal_graph_connection.hpp:23
float automation_range_lo
Definition signal_graph_connection.hpp:39
bool automation
Definition signal_graph_connection.hpp:27
bool audio_rate_modulation
Definition signal_graph_connection.hpp:29
bool midi
Definition signal_graph_connection.hpp:25
float automation_range_hi
Definition signal_graph_connection.hpp:40
PortIndex dest_port
Definition signal_graph_connection.hpp:22
bool spectral
Definition signal_graph_connection.hpp:43
NodeId source_node
Definition signal_graph_connection.hpp:19
bool sidechain
Definition signal_graph_connection.hpp:30
AutomationMix automation_mix
Definition signal_graph_connection.hpp:42
uint32_t automation_param_id
Definition signal_graph_connection.hpp:38
float automation_smoothing_ms
Definition signal_graph_connection.hpp:41
PortIndex source_port
Definition signal_graph_connection.hpp:20