graph.h
A graph of hosted plugins.
#include <sonore/graph.h>- 1type
- Guides: Hosting plugins
On this page
Design notes
host.h loads one plugin. This wires several together: a chain, a parallel split, a diamond, whatever an application's routing needs: a processor graph.
The part that makes it more than a for-loop is DELAY COMPENSATION. A plugin that oversamples or looks ahead answers late and says so. Put one on a parallel branch and the two branches no longer line up, and summing them is a comb filter: the exact failure this SDK has been measuring in individual plugins for weeks, one level up. So the graph works out how late every node is, and delays the branches that are early until they agree.
WHAT IS HERE:
Arbitrary routing between nodes, cycles refused, and TWO kinds of edge. Audio edges carry a stream. MIDI edges carry notes, which is what lets an arpeggiator drive a synth, the canonical reason to want a graph at all, and something a single edge type cannot express, because the arpeggiator produces no audio and the synth consumes none. A node with no MIDI edge into it receives whatever MIDI the CALLER passed to process(), which keeps the simple case simple: a rack of effects fed by a keyboard needs no MIDI wiring at all.
WHAT IS NOT:
Per-edge channel mapping. An edge carries the whole stream; a graph that needs channel 3 of one node on channel 1 of another wants a matrix, and pretending an edge can do it would be a silent truncation.
Types 1
Plugins as nodes, audio as edges.
Two endpoints exist without being added: kInput is where the caller's audio enters and kOutput is where it leaves. A graph with no path between them is legal and silent, which is what an empty rack should be.