Project Generator¶
Copies gen~ export files, runs template substitution, and invokes platform-specific project generation.
project ¶
Project generator for gen_dsp.
Creates new project structures from gen~ exports using templates. Uses the platform registry for platform-specific project generation.
ProjectConfig
dataclass
¶
ProjectConfig(
name: str,
platform: str = "pd",
buffers: list[str] = list(),
apply_patches: bool = True,
output_dir: Optional[Path] = None,
shared_cache: bool = True,
board: Optional[str] = None,
no_midi: bool = False,
midi_gate: Optional[str] = None,
midi_freq: Optional[str] = None,
midi_vel: Optional[str] = None,
midi_freq_unit: str = "hz",
num_voices: int = 1,
inputs_as_params: Optional[list[str]] = None,
midi_mapping: Optional[MidiMapping] = None,
)
ProjectGenerator ¶
Generate new project from gen~ export or dsp-graph.
Initialize generator with export info and configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
export_info
|
ExportInfo
|
Parsed information from gen~ export. |
required |
config
|
ProjectConfig
|
Configuration for the new project. |
required |
from_graph
classmethod
¶
Create a ProjectGenerator from a dsp-graph Graph object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
Graph
|
A |
required |
config
|
ProjectConfig
|
Project configuration. |
required |
Returns:
| Type | Description |
|---|---|
ProjectGenerator
|
A ProjectGenerator configured for the dsp-graph path. |
generate ¶
Generate the project.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_dir
|
Optional[Path]
|
Output directory. If None, uses config.output_dir or creates a directory named after the project. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to the generated project directory. |
Raises:
| Type | Description |
|---|---|
ProjectError
|
If project cannot be generated. |
ValidationError
|
If configuration is invalid. |