Skip to content

Latest commit

 

History

History
63 lines (45 loc) · 3.57 KB

File metadata and controls

63 lines (45 loc) · 3.57 KB

Examples

Runnable scripts, organized one subdirectory per theme. Every script has a module docstring explaining the idea in full; this table is the map.

Run them from the repository root:

uv run python examples/learnable_structure/learn_control_response.py

Most need only uv sync. The "needs" column flags the exceptions.

Recovering hidden parameters from audio — the core use case.

Example Pattern Needs
automation.py Recover a time-varying automation curve. Widget modulation lifts a slider to an audio-rate input, and the curve is optimized in log-normalized space.
random_sampling_fit.py Fit one model across a whole multi-knob range by random sampling plus minibatching, rather than at a few lattice points.
fit_modal_piano.py Recover an instrument's physical parameters (pitch, inharmonicity, decay, brightness) from a struck tone. --plot needs faustax[viz]
fit_state_space_filter.py System-ID a filter from (input, output) pairs with the faustax.ops.state_space primitive.

When the knob positions are known and the mapping is what you want.

Example Pattern Needs
learn_control_response.py Learn a knob's response curve with it.remap, holding the knob position known. Start here.
learn_mode_select.py Pick the right entry of a categorical nentry menu by gradient descent (Gumbel-softmax).
learn_mode_select_interior.py The harder case: recovering an interior menu entry, which needs temperature annealing. Read learn_mode_select.py first.

Longer pieces that argue a point rather than demonstrate an API.

Example Pattern Needs
audio_loss_design.py Why a paired waveform loss fails against a reference you cannot sample-align, and what to use instead. The other fitting examples all rely on a paired loss; this is when that breaks.
fdn_cross_validation.py Cross-validates the NNX backend against an independent FDN renderer, three ways. Faust with the NNX backend; fdn_toolbox (GPL-3.0 — see NOTICE)

Timing scripts behind the numbers in the performance and ops documentation: bench.py (processor throughput), bench_vs_dasp.py (every shared processor head-to-head against dasp-pytorch, forward and gradient; needs torch + dasp-pytorch installed), bench_ops_vs_torch.py, bench_state_space.py, and scan_cost_probe.py.

A note on imports

The parameter_estimation/, learnable_structure/ and studies/ scripts double as the test suite's fixtures: tests/test_automation.py and friends import them directly to assert that the documented behaviour still holds. pytest puts those three subdirectories on sys.path via the pythonpath setting in pyproject.toml.

That means an example's function signatures are part of the tested surface. If you rename or re-signature a top-level function here, run uv run pytest.