# Cochlea

MCP server for offline audio rendering from RON scores and detailed analysis of WAV, FLAC, mp3, ogg without playback — agent gets JSON with loudness, pitch, onsets, tempo and a spectrogram.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 15
- Author: richer-richard
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/richer-richard/cochlea
- Updated: 2026-09-19
- HTML: https://affpapa.org/en/nevibecode/mcp/cochlea

## What it does

Agent writes a score as data (RON format), renders PCM with `cochlea render`, then reads the result via `cochlea probe` — JSON report with integrated loudness (LUFS), true peak, onsets, recognized notes in `pitch.melody`, key, tempo and MFCC. Spectrogram is generated to PNG with one `cochlea spectro` command for a single vision call instead of iterating over samples. Loop closes with `cochlea render --verify`: assertions embedded in the score (`.true_peak_below()`, `.pitch_matches_score()`, `.silent_after()`) are checked automatically, agent retries without human confirmation.

All tools read WAV, FLAC (bit-exact decode), mp3 and ogg; FFmpeg not needed. `--from` and `--to` flags cut frame-exact fragments, report times are recalculated relative to the slice. Score specifies tempo, time signature, tracks with instrument presets (`Instrument::preset("saw_lead")`), notes and parameter automation (cutoff, resonance) on a tick-based timeline. Economics: a 3-minute render is ~66 MB of PCM, its probe report is a few KB of JSON.

## Requirements
- Needs: a prebuilt binary from the repository releases

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- render audio from a score without a DAW and verify the result programmatically
- analyze loudness, pitch, onsets and tempo of any audio file via JSON
- generate a spectrogram for the agent instead of reading samples
- check score assertions (peak, pitch, silence) automatically
- import MIDI to score format or transcribe audio back to a score

## Example prompts
- Render the score from `beat.ron` to `mix.wav` and run assertion checks
- Analyze `vocal.mp3` from 42 to 44.5 seconds, output JSON with onsets and pitch
- Draw a mel spectrogram of `drums.wav` to `spec.png` with beat and onset annotations

## Similar
- [songsee](https://affpapa.org/en/nevibecode/skills/songsee.md) — skill · 5100 installs
- [tracelens-analysis-orchestrator](https://affpapa.org/en/nevibecode/skills/tracelens-analysis-orchestrator.md) — skill · 879 installs
- [viznoir](https://affpapa.org/en/nevibecode/mcp/viznoir.md) — MCP server · ★ 19
- [sector-overview](https://affpapa.org/en/nevibecode/skills/sector-overview.md) — skill · 1200 installs
- [measure-survey-analysis](https://affpapa.org/en/nevibecode/skills/measure-survey-analysis.md) — skill · 634 installs
- [alayarenderer-generative-world](https://affpapa.org/en/nevibecode/skills/alayarenderer-generative-world.md) — skill · 564 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
