Skip to content

Graph Compiler

Compiles a Graph to standalone C++ code (no genlib dependency).

compile

C++ code generation from DSP graphs.

compile_graph

compile_graph(graph: Graph) -> str

Compile a DSP graph to standalone C++ source code.

Raises ValueError if the graph is invalid or contains IDs that are not valid C identifiers.

compile_graph_to_file

compile_graph_to_file(
    graph: Graph, output_dir: str | Path
) -> Path

Compile a DSP graph and write {name}.cpp to output_dir.

Creates the output directory if it doesn't exist. Returns the path to the written file.