Skip to main content

Crate aether_ndk

Crate aether_ndk 

Source
Expand description

Aether Node Development Kit

Everything a third-party developer needs to build a DSP node:

use aether_ndk::prelude::*;

#[aether_node]
pub struct Tremolo {
    #[param(name = "Rate", min = 0.1, max = 20.0, default = 4.0)]
    rate: f32,
    #[param(name = "Depth", min = 0.0, max = 1.0, default = 0.5)]
    depth: f32,
    phase: f32,
}

impl DspProcess for Tremolo {
    fn process(
        &mut self,
        inputs: &NodeInputs,
        output: &mut NodeOutput,
        params: &mut ParamBlock,
        sample_rate: f32,
    ) {
        let input = inputs.get(0);
        for (i, out) in output.iter_mut().enumerate() {
            let rate = params.get(0).current;
            let depth = params.get(1).current;
            let lfo = 1.0 - depth * 0.5 * (1.0 - (self.phase * std::f32::consts::TAU).cos());
            *out = input[i] * lfo;
            self.phase = (self.phase + rate / sample_rate).fract();
            params.tick_all();
        }
    }
}

Modules§

node
Node registration and factory system.
param
Parameter utilities for node authors.
prelude
Prelude — import everything needed to write a node.
registry
Built-in node registry — pre-registers all aether-nodes types.
schema
JSON schema generation for registered nodes. Used by the CLI and manifest system.

Macros§

register_node
Register a node type into a NodeRegistry.

Structs§

NodeAdapter
Adapter that bridges DspProcessDspNode so NDK nodes work transparently inside the AetherDSP engine.
NodeInputs
Ergonomic wrapper around the raw input buffer array.
ParamBlock
A fixed-size block of parameters for a node. Sized to fit common DSP nodes without heap allocation.
ParamDef
A parameter definition — name, range, and default value. Generated statically by #[aether_node].
StateBlob
Opaque state blob — large enough for all built-in node types. Stored as raw bytes to avoid generics in the graph.

Constants§

BUFFER_SIZE
Audio buffer size in samples. Hard real-time constraint: 64 samples @ 48kHz = 1.33ms deadline.
MAX_INPUTS
Maximum number of inputs per node. Kept small to fit in cache lines.

Traits§

AetherNodeMeta
Metadata trait auto-implemented by #[aether_node].
DspNode
The core DSP processing trait. Implementations MUST be real-time safe:
DspProcess
The processing trait node authors implement. Simpler than DspNode — no raw pointer handling required.

Functions§

into_node
Convenience function: wrap any DspProcess + AetherNodeMeta into a boxed DspNode ready for the graph.

Type Aliases§

NodeOutput
Ergonomic wrapper around the output buffer.

Attribute Macros§

aether_node