Skip to main content

Crate ferraus_core

Crate ferraus_core 

Source
Expand description

§ferraus-core

Shared foundation for every ferraus crate:

  • AudioBuffer — planar f32 audio, the internal format of every stage.
  • units — the shared parser for 1.5s, -6dB, 2kHz, C4, 4:1, 80%, 1/16.
  • op — OpSpec: the single definition of a command from which the CLI, fx stages, pipelines, JSON Schemas, MCP tools, and docs are generated.
  • exec — the executor shared by the CLI, pipelines, and the MCP server.
  • envelope — the --json result envelope and provenance sidecars.
  • pipeline — pipeline files with content-hash stage caching.

Re-exports§

pub use buffer::db_to_lin;
pub use buffer::lin_to_db;
pub use buffer::AudioBuffer;
pub use buffer::MediaBuffer;
pub use ctx::AudioIo;
pub use ctx::AudioReader;
pub use ctx::AudioWriter;
pub use ctx::EncodeOptions;
pub use ctx::Globals;
pub use ctx::OpCtx;
pub use ctx::Progress;
pub use ctx::SourceInfo;
pub use envelope::Envelope;
pub use envelope::Sidecar;
pub use envelope::FERRAUS_VERSION;
pub use envelope::SCHEMA_VERSION;
pub use error::Error;
pub use error::ErrorKind;
pub use error::Result;
pub use op::param;
pub use op::Args;
pub use op::Category;
pub use op::InputKind;
pub use op::Inputs;
pub use op::OpSpec;
pub use op::ParamKind;
pub use op::ParamSpec;
pub use op::Runner;
pub use registry::Registry;

Modules§

buffer
Planar f32 audio buffers and the MediaBuffer enum reserved for v2 video.
builtin
Ops implemented by the core itself: fx, pipeline, presets, schema, describe, replay, and verify.
ctx
The execution context handed to every op: global flags, input/output helpers, and the collectors for warnings, metrics, models, and resolved parameter notes.
envelope
The --json result envelope and the provenance sidecar.
error
Error type shared by every ferraus crate, with stable exit codes.
exec
The executor: runs one op with resolved args, handling batches, --mix, fx chains, dry runs, idempotent outputs, output encoding overrides, and sidecars. The CLI, the pipeline runner, and the MCP server all go through Runtime::invoke.
op
Operation specs: the single definition of every command. The CLI, fx stages, pipeline stages, JSON Schemas, MCP tools, describe --agent, and the docs are all generated from these, so parameter names and help text are written exactly once.
paths
Per-platform config, cache, and data directories. FERRAUS_HOME overrides cache and data; FERRAUS_CONFIG overrides the config file.
pipeline
Pipeline files: a graph of stages over named inputs, run with content-hash caching so a re-run after editing one stage recomputes only what changed.
prelude
Everything an op-defining crate usually needs.
registry
The registry of every op, assembled by the CLI from each crate’s ops().
resample
Windowed-sinc sample-rate conversion (Kaiser window), used for output encoding overrides and by model pipelines that need a fixed rate. ferraus-dsp’s resample command uses this same engine with a quality setting.
schema
JSON Schema (draft 2020-12) generated from op specs, for ferraus schema, MCP tool definitions, and validation of agent-supplied arguments.
testing
Test helpers shared by every crate: synthetic signals generated by code (never binary fixtures in git), a ready-made context, and comparison metrics.
units
The shared unit parser: time, gain, frequency, ratios, percentages, musical grids, cents and semitones, byte sizes. Every command uses these so 1.5s, -6dB, C4, 1/8T mean the same thing everywhere.
wav
A minimal, dependency-free WAV reader/writer (PCM 8/16/24/32 and float 32/64). It backs SimpleIo, which every crate uses in tests; the real codec layer lives in ferraus-codec.