# Beat grid editor

- Human page: https://happytails.ai/en/media-tools/beat-grid-editor/
- Markdown: https://happytails.ai/en/media-tools/beat-grid-editor.md
- Structured JSON: https://happytails.ai/agents/en/media-tools/beat-grid-editor/index.json
- Visibility: public

## Tool capabilities

| Property | Value |
| --- | --- |
| Tool ID | `beat-grid-editor` |
| Category | media-tools |
| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |
| Browser execution | Use the visible action or interactive controls. |
| Browser processing | Browser; see tool notes for network behavior. |
| HTTP API | Not callable through HTTP. |
| Browser-agent interface | run_current_tool |

### Implementation notes

Runs locally in your browser. Estimates the tempo of one recording up to 10 minutes and 256 MiB; correct the tempo or first beat and run again before you export.

### Inputs and settings

No free-text input is required. Use the file inputs and/or settings below.

Accepted browser files: `.wav,.mp3,.m4a,.aac,.flac,.ogg,.oga,.opus,.webm,audio/*`. Choose one file.

Browser file-input limit: 268435456 bytes in total. HTTP limits can differ.

| Setting | Meaning | Control type | Default | Constraints |
| --- | --- | --- | --- | --- |
| `minBpm` | Lowest tempo to consider (BPM) | number | "60" | min=30 max=300 step=1 |
| `maxBpm` | Highest tempo to consider (BPM) | number | "200" | min=40 max=400 step=1 |
| `beatsPerBar` | Beats per bar | number | "4" | min=1 max=12 step=1 |
| `bpm` | Corrected tempo (BPM, 0 to use the estimate) | number | "0" | min=0 max=400 step=0.001 |
| `firstBeat` | Corrected first beat (seconds, -1 to use the estimate) | number | "-1" | min=-1 max=600 step=0.001 |

### Browser-agent workflow

1. Open the human page in a browser that supports WebMCP.
2. Discover the interface exposed by that page; use its actual schema.
3. Select files on the page first when the tool requires files.
4. Call `run_current_tool` with valid input and settings.
5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.

Calls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.

### Planning specification

One file up to 256 MiB, 10 minutes, 8 channels and 60 million samples, with at least 2 seconds of audio. Search range 30 to 300 BPM for the lowest and 40 to 400 BPM for the highest tempo, the lowest below the highest. Corrected tempo 0 (use the estimate) or 30 to 400 BPM, corrected first beat -1 (use the estimate) or 0 to 600 seconds, 1 to 12 beats per bar and at most 200,000 beats. WAV is read directly with every channel and sample intact. MP3, M4A, AAC, FLAC, OGG, Opus and WebM are decoded by your browser and resampled to 48 kHz first, so decoding support depends on the browser. Files are decoded and measured on your device and are never uploaded. Downloads: JSON report, CSV of beats and a MIDI tempo map.

This describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.

### Complete machine-readable capability record

```json
{
  "id": "beat-grid-editor",
  "category": "media-tools",
  "built": true,
  "requirements": "One file up to 256 MiB, 10 minutes, 8 channels and 60 million samples, with at least 2 seconds of audio. Search range 30 to 300 BPM for the lowest and 40 to 400 BPM for the highest tempo, the lowest below the highest. Corrected tempo 0 (use the estimate) or 30 to 400 BPM, corrected first beat -1 (use the estimate) or 0 to 600 seconds, 1 to 12 beats per bar and at most 200,000 beats. WAV is read directly with every channel and sample intact. MP3, M4A, AAC, FLAC, OGG, Opus and WebM are decoded by your browser and resampled to 48 kHz first, so decoding support depends on the browser. Files are decoded and measured on your device and are never uploaded. Downloads: JSON report, CSV of beats and a MIDI tempo map.",
  "implementation": {
    "fields": [
      {
        "key": "minBpm",
        "label": "Lowest tempo to consider (BPM)",
        "value": "60",
        "type": "number",
        "min": 30,
        "max": 300,
        "step": 1
      },
      {
        "key": "maxBpm",
        "label": "Highest tempo to consider (BPM)",
        "value": "200",
        "type": "number",
        "min": 40,
        "max": 400,
        "step": 1
      },
      {
        "key": "beatsPerBar",
        "label": "Beats per bar",
        "value": "4",
        "type": "number",
        "min": 1,
        "max": 12,
        "step": 1
      },
      {
        "key": "bpm",
        "label": "Corrected tempo (BPM, 0 to use the estimate)",
        "value": "0",
        "type": "number",
        "min": 0,
        "max": 400,
        "step": 0.001
      },
      {
        "key": "firstBeat",
        "label": "Corrected first beat (seconds, -1 to use the estimate)",
        "value": "-1",
        "type": "number",
        "min": -1,
        "max": 600,
        "step": 0.001
      }
    ],
    "registrationFamily": "audio-pcm-measurement",
    "presentation": "metrics",
    "files": true,
    "input": false,
    "accept": ".wav,.mp3,.m4a,.aac,.flac,.ogg,.oga,.opus,.webm,audio/*",
    "maxFileBytes": 268435456,
    "inputErrorCode": "AUDIO_PCM_MEASUREMENT_TOO_LONG",
    "multiple": false,
    "note": "Runs locally in your browser. Estimates the tempo of one recording up to 10 minutes and 256 MiB; correct the tempo or first beat and run again before you export.",
    "experience": {
      "automatic": false,
      "single": false,
      "inputMaxLength": 1000000,
      "inputMode": "text",
      "label": "Audio file",
      "placeholder": "Choose a WAV, MP3, M4A, FLAC or OGG file",
      "help": "Run once for the estimate, then correct the tempo or first beat below. Up to 1,000,000 characters. Review the settings before running.",
      "action": null
    },
    "mode": "explicit",
    "interactive": false
  },
  "execution": "Browser interface",
  "api": null,
  "browser_agent": {
    "supported": true,
    "name": "run_current_tool",
    "discovery": "WebMCP on the human page in a supporting browser",
    "verification": "See audit/API-AUDIT.md; availability is not verification"
  }
}
```

## Page guide

Estimate the tempo and beat positions of a recording, correct the tempo or first beat yourself, then export the beat grid as CSV and a MIDI tempo map.

### How to use Beat grid editor

1. Choose one audio file from your device.
2. Set the tempo range to search and the beats per bar.
3. Run the estimate and compare it with what you hear, including the half and double tempo alternatives.
4. If it is off, enter the corrected tempo or first beat time and run again.
5. Download the beat CSV and the MIDI tempo map.

How can we improve this tool?

Report a problem or share an idea.

Please leave out private information. Your message and the tool name go to our team via PostHog.

## Useful next steps

- [Music key detector](https://happytails.ai/en/media-tools/music-key-detector/) ([Markdown](https://happytails.ai/en/media-tools/music-key-detector.md))

- [Change audio speed](https://happytails.ai/en/media-tools/change-audio-speed/) ([Markdown](https://happytails.ai/en/media-tools/change-audio-speed.md))

- [Trim audio](https://happytails.ai/en/media-tools/trim-audio/) ([Markdown](https://happytails.ai/en/media-tools/trim-audio.md))

## How the estimate works

The tool builds an onset curve from the spectral flux of 23 millisecond frames, finds the strongest repeating period with an autocorrelation that slightly favours tempos near 120 BPM, refines it with a comb search and aligns the beat phase to the onsets. The beat position with the strongest accumulated onsets is taken as beat 1 of each bar. Half and double tempos are listed because they are the most common mistake.

### Correcting the grid

The result is an estimate. Enter a corrected tempo, a corrected first beat time, or both, and run again: the grid is then rebuilt exactly from your values with a constant tempo, starting on beat 1 at your first beat. The report keeps the original estimate next to the values used.

### What is exported

The CSV lists every beat with its time in seconds, bar and beat number. The MIDI file is a type 0 tempo map with one tempo event and one wood block click per beat (high on beat 1), so a music program can follow the recording. Tempo changes within the recording are not detected; a constant grid drifts on music that speeds up or slows down.
