openalice-media
[Atlas card](https://atlas.blal.pro/repos/openalice-media)
Architecture rating
Clean modular layout — 5 cohesive cargo crates, 0 circular deps, 0 dead imports, drift 100/manifest 100; undercut by 102 star imports and 19 duplicate signatures showing uneven idiom adoption across crates.
Strong top-level docs — valid manifest (100), AGENTS.md + README present, 9 @feature annotations (features 92); weakened by 261 missing docstrings across modules and roadmap 30/100 (the repo's weakest quality dimension).
Rust memory-safety helps, no circular deps; but no SIGTERM/idempotency/retry needs for an offline lib, and inspector flags 19 god modules + max complexity 27 with no visible error-handling tests, so robustness of audio-graph processing is unverified.
Offline Rust/WASM audio library — zero network/auth surface (runtime_deps 0, no https endpoint), so SSRF/injection/rate-limit/headers are largely N/A; but no demonstrated input-validation or unsafe-block audit on WAV/MIDI parsing, graded conservatively for absent evidence.
No database, schema, or migrations (migrations/tests section empty, manifest_owns_tables []); persistence is 1342 WAV samples on filesystem — no RLS/FK/tenant/GDPR concerns apply, scored conservatively as the axis is essentially N/A with no constraints to evaluate.
No metrics, tracing, health probes, or structured logging — Atlas health probe fails (no https endpoint in manifest), 0 console statements; appropriate for a library but no instrumentation signal whatsoever, graded absent.
No test suite detected (migrations/tests presence empty, no #[test]/integration signal); the 14 unreferenced `main` fns are example binaries, not tests — critical audio-graph/euclidean/reverb paths have no automated coverage.
source · auto-grader-2026-06-16
Ecosystem manifest
.atlas-deps.ymlRust + WASM AI-agent-native audio creation platform — audio graph, euclidean rhythms, Schroeder reverb, 9 genre KBs, MIDI export, 1342 WAV samples.
- cargo_crate: openalice-media-core
- cargo_crate: openalice-media-music
- cargo_crate: openalice-media-tools
- cargo_crate: openalice-media-voice
- cargo_crate: openalice-media-sfx
Code composition
tokei · loc- Rust99.1%
- TOML0.9%
- Rust99.1%
- TOML0.9%
- Rust99.1%· 8,687
- TOML0.9%· 83
| Language | % code | code | comments | blanks | files |
|---|---|---|---|---|---|
| Rust | 99.1% | 8,687 | 585 | 1,387 | 40 |
| TOML | 0.9% | 83 | 6 | 12 | 6 |
| Markdown | 0.0% | 0 | 71 | 37 | 2 |
Telemetry ribbon · last 90 days
2 eventsmedia/core
2 features- media.core.music-theorycrates/media-core/src/time.rs:3Tempo (BPM↔samples, swing offset), Note (12 pitch classes, MIDI, Hz), 15-scale Scale enum (Major → Chromatic), and octave-range MIDI note sets. Shared music-theory primitives used by sequencer, melody, and genre modules.
- media.core.pcm-buffercrates/media-core/src/buffer.rs:3Interleaved f32 PCM buffer with mono/stereo helpers, WAV read/write (hound), equal-power crossfade, peak normalize, and clamp. Shared foundation for all audio processing in the openalice-media workspace.
media/music
6 features- media.music.arrangementcrates/media-music/src/arrangement.rs:3`Song` holds named `Track`s and ordered `Section`s (intro→build→drop→outro). Each section activates a subset of tracks with gain overrides; master chain applies compressor + saturator per section. `demo_song` builds a 32-bar structured track from the sample library at runtime. A `Song` consists of named `Section`s (intro, verse, drop, etc.) arranged in sequence. Each section specifies which tracks are active and at what gain. The engine renders sections sequentially with optional crossfades.
- media.music.audio-graphcrates/media-music/src/graph.rs:3Directed acyclic graph (petgraph StableGraph) of DspNode processors. Topological sort ensures correct processing order; cycle detection prevents hangs. Core routing primitive for all rendered audio in openalice-media. Topological sort ensures correct processing order (sources → sinks). Multiple inputs to a node are passed as `&[&Block]`.
- media.music.automationcrates/media-music/src/automation.rs:3Keyframed `Automation` curves (step/linear/S-curve/exponential), `FilterSweep` (LP/HP with perceptually-linear exponential sweep), `SidechainCompressor` with `house_pump()` preset, and `NoiseRiser` (white noise through sweeping HP filter). All implemented as `DspNode`s for direct placement in the audio graph. These are time-varying DSP nodes that change parameters over the course of a section or song, enabling professional production techniques.
- media.music.genre-knowledgecrates/media-music/src/genres.rs:39 GenrePresets (House, Techno, DnB, Hip-Hop, Lo-fi, Psytrance, Classical, EDM, Ambient) each with BPM range, sub-genres, moods (energy/darkness/tempo bias), AI prompt template, drum hints, effects chain, and recommended samples. `genre_prompt(genre, mood, sub_genre)` builds a structured prompt for an LLM agent to generate genre-correct music from scratch. Each genre defines: BPM range, time signature, recommended samples, chord progressions, patterns, effects chain, and sub-genres with moods. An AI agent reads these presets to generate genre-appropriate tracks.
- media.music.mini-notationcrates/media-music/src/notation.rs:3Compact pattern DSL: sequences, subdivisions `[a b]`, alternations `<a b>`, Euclidean rhythms `(3,8)`, speed `*n`/`/n`, rests `~`. Bjorklund algorithm for Euclidean distribution. Pattern→DrumPattern conversion for audio rendering. Compact notation for patterns: ```text "bd sd [hh hh] cp" → kick, snare, two hi-hats (subdivided), clap "bd*2 sd" → kick played twice fast, then snare "bd/2" → kick at half speed "<bd sd cp>" → alternate between kick, snare, clap each cycle "(3,8)" → euclidean rhythm: 3 hits in 8 steps "~ bd" → rest, then kick ```
- media.music.pattern-dslcrates/media-music/src/pattern.rs:3Human- and LLM-writable grid notation: "kick: x . x . | . . x ." Parses named tracks, maps instrument names to DrumSound variants, and renders to AudioBuffer via BPM-locked sample placement. Patterns use a simple grid notation that is both human-readable and LLM-parseable: ```text ``` Each `x` = hit, `.` = rest, `|` = bar divider (visual only).
media/tools
1 feature- media.tools.agent-interfacecrates/media-tools/src/lib.rs:3JSON-schema tool definitions + typed Rust handlers for OpenAI/Anthropic function-calling: `music_pattern_create`, `music_render` (→WAV), `music_midi_export` (→SMF). The main OpenAlice agent calls these tools; handlers dispatch to media-music internals and return human-readable results. Provides tool schemas and handlers for the OpenAlice agent system: - `music_pattern_create` — create drum/melody patterns from notation - `music_render` — render patterns to audio (WAV) - `music_midi_export` — export patterns to MIDI files - `music_play` — preview audio in the browser