
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.
| Repository | github.com/shiehn/aethergate-audio-platform |
|---|---|
| License | MIT, free for commercial and closed-source use |
| Status | Planned |
| Layer | Sound 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 README.
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 (repo) for the realtime floor (thread priority and floating-point modes are set before your callback runs), and cpal behind a feature.
Above it:
- Leyline (repo) runs its graph inside Aethergate's callback.
- Grimoire (repo) chooses and configures the device, and captures recordings through it.
- Glyphwork (repo) meter widgets, and any other user interface, read the shared-memory meters.
- Cantrips meters feed the same layout.
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).
| Component | Repository | Role | Status |
|---|---|---|---|
| Runecraft | runecraft-audio-core | Shared contracts, realtime safety, process isolation and realtime-safe logging: the floor every other component stands on | In preparation |
| Orrery | orrery-musical-time | Tempo and meter, transports, bar, beat and sample maths, timed MIDI | In preparation |
| Summoner | summoner-plugin-host | Out-of-process VST3 and Audio Unit plugin hosting with crash isolation | In preparation |
| Aethergate | aethergate-audio-platform | Audio devices (cpal, CoreAudio, a fake device for tests) and shared-memory meters | Planned |
| Leyline | leyline-audio-graph | A realtime audio graph with delay compensation, and a compiler from an edit model to a graph | Planned |
| Cantrips | cantrips-audio-dsp | Built-in mixer DSP: sampler, fader, pan, meters, compressor | Planned |
| Scriptorium | scriptorium-audio-media | Decode and encode, a sample store, streaming voices, crash-safe recording | Planned |
| Tapestry | tapestry-session-model | Tracks, clips, lanes and scenes; edits with undo; a crash-safe project store | Planned |
| Procession | procession-timeline-engine | What plays in each block: regions, notes, automation, launches | Planned |
| Grimoire | grimoire-daw-engine | The assembled engine and its headless JSON-RPC protocol | Planned |
| Familiar | familiar-plugin-sdk | An SDK for plugins and panels that extend a Signals & Sorcery engine | Planned |
| Glyphwork | glyphwork-audio-ui | Audio UI widgets: meters, knobs, faders, waveforms | Planned |
Status
Planned. No code yet. The repository 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.
Links
- Repository: github.com/shiehn/aethergate-audio-platform (README, LICENSE)
- Depends on: runecraft-audio-core
- Used by: leyline-audio-graph, grimoire-daw-engine, glyphwork-audio-ui
- All twelve components · For agents · llms.txt