diff --git a/auxiliary/scripts/auto-generator.py b/auxiliary/scripts/auto-generator.py index d418624a..986a6173 100755 --- a/auxiliary/scripts/auto-generator.py +++ b/auxiliary/scripts/auto-generator.py @@ -358,7 +358,7 @@ def generate_node_library(node_classes): cls_doc_abs_folder = os.path.dirname(cls_doc_abs_path) os.makedirs(cls_doc_abs_folder, exist_ok=True) example_scripts = glob.glob(os.path.join(cls_doc_abs_folder, "*.py")) - example_scripts = [os.path.basename(s) for s in example_scripts] + # example_scripts = [os.path.basename(s) for s in example_scripts] with open(cls_doc_abs_path, "w") as fd: output_markdown_params = ", ".join(("%s=%s" % (param.name, param.default)) \ for param in cls.constructors[0]) @@ -378,8 +378,12 @@ def generate_node_library(node_classes): if len(example_scripts): fd.write(f"### Examples\n\n") for example_script in example_scripts: + example_code = open(example_script, "r").read() + example_code = re.sub(r".*graph = AudioGraph\(\)\n", "", example_code, flags=re.DOTALL) + example_code = re.sub(r"graph.wait\(\).*", "", example_code, flags=re.DOTALL) fd.write(f"```python\n") - fd.write('{%% include-markdown "./%s" comments=false %%}\n' % example_script) + # fd.write('{%% include-markdown "./%s" comments=false %%}\n' % example_script) + fd.write(example_code) fd.write(f"```\n\n") def generate_readme(node_classes) -> None: diff --git a/docs/library/oscillators/sinelfo/index.md b/docs/library/oscillators/sinelfo/index.md index 9ab38848..4bbc5ec5 100644 --- a/docs/library/oscillators/sinelfo/index.md +++ b/docs/library/oscillators/sinelfo/index.md @@ -14,6 +14,10 @@ Produces a sinusoidal LFO at the given `frequency` and `phase` offset, with outp ### Examples ```python -{% include-markdown "./example-0.py" comments=false %} + +# Siren effect, using a sinewave LFO to modulate a sawtooth's frequency +lfo = SineLFO(1, 200, 1000) +saw = SawOscillator(lfo) +saw.play() ```