sound_to_patch/lib.rs
1//! Turn an audio stem or a written sound description into a starting point
2//! in a target synth, Vital or Serum 2.
3//!
4//! The library holds all logic. The `sound-to-patch` binary parses the
5//! command line with [`cli::Cli`], calls the library and prints the result.
6//! The library itself never prints.
7//!
8//! # Modules
9//!
10//! - [`audio`]: stem intake. Decodes a file at its native rate, mixes it to
11//! mono and resamples it for a consumer with a fixed rate.
12//! - [`cli`]: the command-line definition, shared by the binary and by the
13//! generators of the man pages and the shell completions.
14//! - [`confidence`]: how far a layer trusts an estimate, as a level with
15//! reasons and a spread, or no estimate.
16//! - [`dsp`]: the signal core: windows, STFT, peak picking, active frames,
17//! the analytic signal and decay fits.
18//! - [`estimate`]: the layer estimators that read the note list and the f0
19//! track: the pitch layer with its glides, pitch drops and vibrato, and
20//! the envelope layer with the note envelopes and the sidechain pump, and
21//! the voices layer with the count of voices and the joins of a mono line.
22//! - [`music`]: the music dictionary for notes, embedded from
23//! `dictionary/music/`, with the key, note-name, numeral and chord-symbol
24//! parsers, the snap rule and the rhythm arithmetic.
25//! - [`notes`]: the note list that every layer reads, the transcriber with
26//! its profiles and its register detection, the f0 track, the cleanup
27//! with the quiet-note guard, the notes step of a stem, the MIDI reader
28//! and writer, and the harmonic masks built from the list.
29//! - [`preset`]: preset files behind one adapter per synth: the format
30//! traits, the parameter registry with its laws, the template, the edit
31//! list and its applier, the mapper trait that turns layer values into
32//! edits, and the Vital adapter.
33//! - [`render`]: rendering a preset and its notes to audio: the recipe, the
34//! render job and record, the renderer trait, a fake renderer for tests,
35//! the plug-in state of a preset and the renderer that drives the plug-in
36//! host process.
37//! - [`report`]: the outputs of a stem: `layers.json`, the spectrogram
38//! image and the final `notes.mid` with the `analyze` pipeline that
39//! writes them, and the first `notes.mid` with the `notes` command.
40//! - [`synth`]: the target synth, the shared `--synth` argument and what
41//! each synth offers in structure.
42//! - [`units`]: unit newtypes, checked once when built, with their
43//! conversions, serde and the unit-string parser.
44
45pub mod audio;
46/// The audited numeric casts of `core`, for the developer tools and the
47/// integration tests, so they carry no copies.
48#[doc(hidden)]
49pub use sound_to_patch_core::cast;
50pub mod cli;
51pub mod confidence;
52pub mod dsp;
53pub mod estimate;
54pub mod music;
55pub mod notes;
56pub mod preset;
57pub mod render;
58pub mod report;
59pub mod synth;
60#[doc(inline)]
61pub use sound_to_patch_core::units;
62pub mod words;