Aethergate audio platform illustration

Aethergate

The audio device layer, plus meters other processes can read.

Aethergate is the component that connects an engine to real audio hardware, and to a fake device for tests. It is part of Signals & Sorcery, a coherent set of Rust audio building blocks for audio apps, plugins, players and DAWs.

Repositorygithub.com/shiehn/aethergate-audio-platform
LicenseMIT, free for commercial and closed-source use
StatusPlanned
LayerSound and devices (how the layers stack)
Crates (planned names)aethergate

What it is

An engine needs a callback that runs once per hardware block, with input and output buffers and an accurate idea of when that block will be heard. Aethergate gives every component above it one trait for that, with several backends behind it:

  • A cpal backend, the default on every platform.
  • A CoreAudio backend for macOS, optional, for direct control: realtime thread policy, paired input and output devices, and the device's own timing.
  • A fake device that runs the callback from a plain thread, or step by step from a test, with no hardware.
  • No device at all, for offline render: the engine drives the callback as fast as it can.

It also holds shared-memory meters. An engine whose user interface runs in another process (a web view, an Electron shell, a Python notebook) needs levels at display rate without a round trip per frame. The meter layout is a block of shared memory described by a descriptor, written by the audio side with a sequence lock and read by any process that maps it. Ballistics (peak hold, decay) are part of the contract, so every reader shows the same thing. A small C header lets non-Rust readers join in.

Usage example

Illustrative sketch

Planned, not final. Taken from the READMEopen in new window.

use aethergate::{AudioDevice, CpalBackend, DeviceConfig, IoCallback, IoTime};

struct Player { /* your engine */ }

impl IoCallback for Player {
    // Called on the device's realtime thread: no allocation, no lock, no blocking.
    fn process(&mut self, input: &[&[f32]], output: &mut [&mut [f32]], time: &IoTime) {
        self.render(output, time.sample_position);
    }
}

let mut device = CpalBackend::default_output()?;
let running = device.open(&DeviceConfig { sample_rate: 48_000, block: 256, ..Default::default() },
                          Box::new(Player::new()))?;
// Dropping `running` stops the device.

Swap CpalBackend for FakeDevice in a test and the same engine runs with no sound card, block by block, under your control.

Meters, from the reading side:

let meters = aethergate::meters::Reader::open(&shared_name, &expected_layout)?;
let level = meters.group("tracks").get(3)?;   // peak and RMS, already with ballistics

How it fits in the ecosystem

Aethergate is in the sound and devices row. Dependencies point down, never up.

Below it: Runecraft (repoopen in new window) for the realtime floor (thread priority and floating-point modes are set before your callback runs), and cpal behind a feature.

Above it:

What it deliberately doesn't do: no processing (it moves buffers; the graph fills them), no replacing cpal (cpal stays the portable backend), no MIDI hardware (crates such as midir), and no file I/O (that is Scriptorium).

Extend and display
The engine
Musical structure
Signal flow
ComponentRepositoryRoleStatus
Runecraftrunecraft-audio-coreShared contracts, realtime safety, process isolation and realtime-safe logging: the floor every other component stands onIn preparation
Orreryorrery-musical-timeTempo and meter, transports, bar, beat and sample maths, timed MIDIIn preparation
Summonersummoner-plugin-hostOut-of-process VST3 and Audio Unit plugin hosting with crash isolationIn preparation
Aethergateaethergate-audio-platformAudio devices (cpal, CoreAudio, a fake device for tests) and shared-memory metersPlanned
Leylineleyline-audio-graphA realtime audio graph with delay compensation, and a compiler from an edit model to a graphPlanned
Cantripscantrips-audio-dspBuilt-in mixer DSP: sampler, fader, pan, meters, compressorPlanned
Scriptoriumscriptorium-audio-mediaDecode and encode, a sample store, streaming voices, crash-safe recordingPlanned
Tapestrytapestry-session-modelTracks, clips, lanes and scenes; edits with undo; a crash-safe project storePlanned
Processionprocession-timeline-engineWhat plays in each block: regions, notes, automation, launchesPlanned
Grimoiregrimoire-daw-engineThe assembled engine and its headless JSON-RPC protocolPlanned
Familiarfamiliar-plugin-sdkAn SDK for plugins and panels that extend a Signals & Sorcery enginePlanned
Glyphworkglyphwork-audio-uiAudio UI widgets: meters, knobs, faders, waveformsPlanned

Status

Planned. No code yet. The repositoryopen in new window holds the design.

Target platforms: macOS, Windows and Linux through cpal, with the optional CoreAudio backend on macOS. Web Audio as a backend (an audio worklet calling the same trait) is a later exploration.

Last Updated:
Contributors: shiehn