Skip to main content

Module resolve

Module resolve 

Source
Expand description

The sound resolver: turns an instrument name (piano, strings, plugin:"Surge XT", sf2:/path/gm.sf2) into a concrete sound, in the PRD’s order:

  1. an explicit source (plugin:, sf2:, sfz:, ir:),
  2. an alias from <config>/sounds/aliases.toml ([aliases] piano = "<id or source>"),
  3. an installed or scanned sound whose name, id, or tags match.

General MIDI program names (gm:48) are left to the caller (ferraus-synth), which gets Ok(None) when nothing here matches. Sounds come from the installed sounds folder, --sound-path folders (CLAP/VST3 bundles, .sf2, .sfz libraries, impulse responses), and the plugin scan cache.

Structs§

InstalledRecord
A record in installed.json.
Resolved
How a query was resolved.
Sound
One usable sound.
SoundsEnv
Where the resolver and the sounds registry keep their files. SoundsEnv::from_env uses the standard ferraus folders; tests build one on a temp dir.

Enums§

SoundKind
Kind of sound source.

Functions§

discover
Every sound ferraus can use without a download: installed sounds (with their registry tags), sound_paths folders, and plugins in the scan cache.
discover_files
Files (not plugins) under root: .sf2, .sfz, and IR audio files. Samples inside a folder that holds .sfz files belong to that library and are not listed as IRs.
discover_files_with
Like discover_files; with all_ir, every audio file outside SFZ libraries is an impulse response (used for installed IR packs).
discover_folder
Everything in one folder: sound files plus plugins (probed in a host subprocess, cached).
discover_sounds
discover with the standard ferraus folders and the default watchdog.
infer_category
The category ferraus infers from a name, tags, or path text (first match wins in the order drums, keys, guitar, bass, strings, brass, winds, vocal, pad, synth, fx).
read_aliases
[aliases] from <config>/sounds/aliases.toml.
read_installed
resolve_instrument
resolve_sound with the standard ferraus folders and the default watchdog: the entry point for render --instrument <name> (pass ctx.globals.sound_paths).
resolve_sound
Resolve an instrument (or IR) name. Ok(None) when nothing matches, so callers can fall back to General MIDI names; an ambiguous name is an error listing candidates.
write_aliases
write_installed