API Reference¶
gen-dsp's Python API is organized into three packages:
-
gen_dsp.core-- Pipeline modules: parsing gen~ exports, building manifests, generating projects, and compiling -
gen_dsp.platforms-- Platform registry and backend implementations -
gen_dsp.graph-- Optional graph frontend (requires pydantic)
Data Flow¶
gen~ export dir -> parser.py -> ExportInfo -> manifest.py -> Manifest -> Platform.generate_project()
For the graph frontend:
Graph (Python/JSON) -> graph/compile/ -> C++ -> graph/adapter.py -> Manifest -> ProjectGenerator.from_graph()
Core Modules¶
New to the core API? Start with the Core API guide -- a usage-oriented walkthrough of the parse -> manifest -> generate -> build pipeline with examples. The table below links to the per-symbol reference.
| Module | Description |
|---|---|
parser |
Regex-based parser for gen~ exports, produces ExportInfo |
manifest |
Manifest dataclass: front-end-agnostic IR with ParamInfo |
project |
ProjectGenerator: copies export files, runs template substitution |
builder |
Builder delegates to Platform.build(), returns BuildResult |
patcher |
Applies platform-specific fixes (e.g. exp2f on macOS) |
cache |
Resolves shared FetchContent cache directory |
midi |
MIDI mapping detection and compile-definition generation |
Platform Registry¶
| Module | Description |
|---|---|
platforms |
Platform base class, PLATFORM_REGISTRY, helper functions |
Graph Frontend¶
| Module | Description |
|---|---|
graph.models |
Pydantic models: Graph, Param, node types |
graph.compile |
compile_graph(): Graph to standalone C++ |
graph.validate |
validate_graph(): connectivity and type checks |
graph.optimize |
optimize_graph(): dead-code elimination, constant folding |
graph.simulate |
simulate(): run graph in Python (requires numpy) |
graph.algebra |
series(), parallel(), split(), merge() combinators |
graph.adapter |
Bridge graph output to gen-dsp platform backends |