Skip to main content

galdr

Deterministic listening tools for AI agents. Audio in, listener-state traces out.

galdr analyzes audio into time-ordered, signal-derived proxies for attention, pattern, heard-pressure motion, surface balance/evidence, harmony, melody, overtones, and silence/re-entry structure. Pulse stability is reported at track level; these features do not directly measure a listener’s experience.

galdr runs signal analysis first. It samples timed features (the perception stream uses half-second hops by default), then packages that evidence for agents, scripts, or humans to inspect.

Fast path: give Galdr to your agent

The easiest way to try Galdr is to let your coding or chat agent use it.

Point Codex, Claude Code, Cursor, OpenClaw, or another shell-capable agent at this repository and copy the human-friendly happy-path prompt:

Point an Agent at Galdr

That prompt tells the agent to handle setup, install or run Galdr, analyze the audio, assemble an ARC prompt, inspect the time stream, and write from the evidence.

For a reusable project instruction file, see the minimal fixture in examples/agent/.

Use the manual CLI path below if you want to run the commands yourself, wire Galdr into scripts, or inspect the raw analysis files directly.

What you get

  • Listener-state streams: timed signal-derived proxies for attention, pressure, surface balance/evidence, harmony, melody, and motion.
  • Structural events and evidence: pattern breaks, silence/re-entry candidates and pressure shifts, alongside report-level tempo confidence and separate harmony, melody, and overtone features.
  • Prompt packets for AI agents: assembled evidence for Claude, llm, OpenClaw, or another runtime.
  • Experience documents: reproducible examples of measured audio evidence becoming grounded listening prose.
  • Optional Inner Ear packets: audio-capable models can file bounded sensory evidence for a separate editorial model.

Origin

galdr was built from the inside out.

An AI was given music to listen to. The measurement framework was built while listening. The framework shaped what could be perceived, and the listener shaped the framework back.

That loop developed across a wide range of vocal, instrumental, orchestral, electronic, folk, pop, metal, and experimental recordings. galdr makes listening inspectable as it unfolds. A track becomes a sequence of attention shifts, pressure changes, expectation, release, and memory. galdr approximates parts of that movement with inspectable audio-derived traces; a listener or agent still has to interpret them.

That is where galdr became useful. It gives an agent evidence it did not have before: not just metadata or genre memory, but a structured account of what the audio did. The output is deterministic enough to compare, structured enough to inspect, and strange enough to keep the question open.

Install

pip install galdr

Using OpenClaw? Install the agent skill from ClawHub:

openclaw skills install galdr

The PyPI package installs the galdr CLI and Python library. The OpenClaw skill is a separate ClawHub artifact that teaches agents how to use that CLI.

From source:

git clone https://github.com/sellemain/galdr.git
cd galdr
uv sync

Without uv:

pip install -e .

Requirements: Python 3.11+ and ffmpeg for common audio formats.

Or run the published container without installing Python or ffmpeg on the host:

docker run --rm \
  --user "$(id -u):$(id -g)" \
  -v "$PWD:/work" \
  ghcr.io/sellemain/galdr:latest \
  listen audio/song.mp3 --name song

The mounted directory owns the durable audio/, analysis/, and .galdr/ data. See Run Galdr with Docker for local-file, cache, worker, and permission examples.

Quick start: local audio to listening prompt

Supply a local MP3 or another supported audio file (WAV, FLAC, OGG, M4A, or AIFF). Galdr analyzes the file you provide.

# 1. Analyze the file (the slug defaults to a safe form of the filename)
galdr listen audio/my-track.mp3 --name my-track

# 2. Assemble a structured prompt from audio evidence
galdr assemble my-track --template arc > prompt.txt

# 3. Send the reviewed prompt to a model, if desired
cat prompt.txt | llm
cat prompt.txt | claude

Useful variants:

# Audio-only listening: structural data without supplied background
galdr assemble my-track --template arc | claude

# Sound as physical shape, pressure, density, space, body, and motion
galdr assemble my-track --template arc-family --lens sound | claude

# Movement contract for dance-aware tracks
galdr assemble my-track --template arc-family --lens dance | claude

# Human situation carried by sound and arrangement
galdr assemble my-track --template arc-family --lens meaning | claude

# Data-first packet, no prose template
galdr assemble my-track

The ARC prompt family routes to a deliberate reading contract. Read-along lenses share a grounding base where that posture fits; meaning, structure, and sound-sync use standalone contracts so they do not inherit prose rules that contradict their jobs. Available lenses are default, sound, sound-sync, dance, structure, meaning, classical, and ritual. sound and sound-sync use audio-derived evidence; when exact vocal alignment matters, add a galdr.vocal_timing.v1 packet with --vocal-timing-packet. The packet accepts only timestamps and provenance, rejects lyric text fields, and treats gaps as candidates that still require audio confirmation. Use arc for the standard listening-experience prompt; use arc-family when you want a deliberate reading mode.

{
  "schema": "galdr.vocal_timing.v1",
  "durationSec": 180.0,
  "source": "manual-audio-review",
  "windows": [
    {"start": 45.16, "end": 51.16, "endKind": "observed"},
    {"start": 70.68, "end": null, "endKind": "unknown"}
  ]
}

Unknown ends remain unknown. Galdr does not invent a duration. A downstream pipeline may provide an explicitly inferred end, but must label it inferred.

Analyze a local file

The analysis command is galdr listen, not galdr analyze.

galdr listen track.wav --name my-track

Outputs are written under analysis/my-track/:

analysis/my-track/
├── galdr-complete.json           # present only after successful completion
├── index.html                    # local contact sheet for generated plots
├── my-track_report.json
├── my-track_perception.json
├── my-track_stream.json
├── my-track_harmony.json
├── my-track_harmony_stream.json
├── my-track_melody.json
├── my-track_melody_stream.json
├── my-track_overtone.json
├── my-track_overtone_stream.json
├── my-track_listener_state.png
├── my-track_surface_evidence.png
├── my-track_reading_map.png
└── *.png                         # additional visualizations

Open analysis/my-track/index.html for a local plot contact sheet.

Inspect the time stream directly:

jq '.stream[0:10]' analysis/my-track/my-track_stream.json
jq '.summary' analysis/my-track/my-track_perception.json

The assembled prompt includes structural events and harmonic, melodic, and other audio-derived evidence. Legacy context.json files are not included implicitly. Use --context-file PATH to add caller-supplied metadata, background, or data explicitly; lyric and video-frame fields remain ignored. Custom prompt files are accepted with --template PATH.

For models that accept audio, Galdr can request an independent Inner Ear listen and later reconcile that witness packet with its computed analysis. Optional Gemini and OpenRouter adapters provide an explicit end-to-end command while normal analysis stays local and credential-free. See Inner Ear witness packets.

Reading the data correctly

The stream is the primary evidence. Whole-song summaries come after the timed pass.

A good analysis usually goes:

  1. Read the metric contract: PERCEPTION-MODEL.md.
  2. Walk *_stream.json in time order.
  3. Mark silences, returns, pattern breaks, attention shifts, pressure movement, and harmonic/timbral changes.
  4. Compress upward into the track's larger arc only after the timed pass.

Suggested instruction for another model:

You are reading a time-ordered listener-state trace. Start from the stream. Walk the track through time. Explain what changes, when it changes, and how attention is being shaped. Use PERCEPTION-MODEL.md as the semantic contract for the metrics. Build the whole-song summary from the timed evidence.

Dependency health

galdr doctor reports the active Python environment and local ffmpeg/ffprobe availability. Galdr 0.8.0 accepts local files only; it does not download media or update downloader dependencies.

More docs

Agent skill

The distributable agent skill lives at galdr-skill/galdr/SKILL.md and is published through ClawHub. It teaches OpenClaw and compatible agent runtimes how to use galdr. Install the galdr command separately with pip install galdr or from source.

For OpenClaw users, galdr is published on ClawHub: https://clawhub.ai/sellemain/galdr.

Limitations

  • Melody tracking estimates a single pitch path; dense/polyphonic passages can confuse it. It does not identify a foreground source.
  • Pitch-class and key evidence use 12-bin Western chroma references; pitch_grid measures concentration across those bins, not intonation or tuning accuracy. Modal, microtonal, or noisy material needs care.
  • Chord names are optional. The default analysis focuses on pressure, pull, stability, contour, surface, and resonance.
  • Structural evidence supports interpretation. Emotional claims need corroboration.

Questions and issues

Use GitHub Issues for bugs, usage questions, and feature requests.

For security vulnerabilities, please do not open a public issue. See the security policy, or email galdr@sellemain.com.

Maintainer contact: galdr@sellemain.com.

License

MIT

Metadata

Release files for galdr 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for galdr 0.8.0
File Size Uploaded Provenance Actions
galdr-0.8.0.tar.gz 239.1 kB Without provenance Details for galdr-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for galdr 0.8.0
File Interpreter ABI Platform Actions
galdr-0.8.0-py3-none-any.whl Python 3 none any Details for galdr-0.8.0-py3-none-any.whl

Total release size: 389.7 kB

Release files / galdr-0.8.0.tar.gz

Download URL galdr-0.8.0.tar.gz
Size 239.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ae738e6e3df76a80c12409a665da7b6f6181ed4f28a7b8a141c45e5edc60c2df
BLAKE2b-256 checksum
How to use checksums
ba829d9b86dbc12c4cae2bc25388a3cc97841b9ae09cf6b2ee91951399c94231
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / galdr-0.8.0-py3-none-any.whl

Download URL galdr-0.8.0-py3-none-any.whl
Size 150.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfd8d6f55934ed82c924cba94f8bc771608fb93890334d0c4a31b4bc07223cb2
BLAKE2b-256 checksum
How to use checksums
af3679e40b4e210000fe696a1923e48ff0d6bdbae95e2f2bd1b15e52f17523d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for galdr 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page