Categories

Audio Key Detector

Detect the musical key of a track

Analyzes pitch-class energy over time and matches it to major/minor key profiles.

Click to upload file or drag and drop file here

Maximum file size: 200MB Supported formats: audio/*

Key Facts

Category
Media
Input Types
file, text
Output Type
json
Sample Coverage
4
API Ready
Yes

Overview

The Audio Key Detector analyzes audio files to determine their musical key, enabling quick identification of tonality for musicians, DJs, and producers.

When to Use

  • When preparing tracks for harmonic mixing in DJ sets.
  • When analyzing audio samples to ensure they match a project's key.
  • When studying music theory to identify the tonality of recordings.

How It Works

  • Upload an audio file in a supported format like MP3 or WAV.
  • The tool analyzes pitch-class energy distribution over time.
  • It matches the energy profile to major and minor key templates.
  • Outputs the detected key in JSON format for easy integration.

Use Cases

Harmonic mixing for DJs to create seamless transitions between tracks.
Music production to align samples and loops in the same key.
Educational analysis for students to identify keys in musical pieces.

Examples

1. DJ Setlist Preparation

DJ
Background
A DJ is compiling a setlist for a live performance and needs all tracks in compatible keys for smooth mixing.
Problem
Manually identifying keys is slow and prone to errors, risking dissonant transitions.
How to Use
Upload each audio track to detect its key, then arrange the setlist based on harmonic compatibility.
Outcome
The DJ creates a cohesive setlist with tracks in matching or related keys, enhancing the mix flow.

2. Sample Key Matching

Music Producer
Background
A producer is working on a song and wants to incorporate a downloaded sample but doesn't know its key.
Problem
Using a sample in the wrong key can cause clashes with other instruments in the project.
How to Use
Upload the sample file and set analysisSeconds to 30 to focus on the main section for key detection.
Example Config
analysisSeconds: 30
Outcome
The producer confirms the sample's key and adjusts the project tempo or pitch for harmonic consistency.

Try with Samples

audio, file

Related Hubs

FAQ

What audio formats are supported?

Common audio formats such as MP3, WAV, and others under the audio/* type.

How accurate is the key detection?

It uses pitch-class energy analysis for reliable matching to major and minor keys.

Can I analyze only a portion of the audio?

Yes, use the analysisSeconds option to specify the duration to analyze, defaulting to 90 seconds.

What does the output look like?

A JSON object with the detected key, e.g., {"key": "C major"}.

Is there a file size limit?

Yes, audio files must be under 200 MB.

API Documentation

Request Endpoint

POST /en/api/tools/audio-key-detector

Request Parameters

Parameter Name Type Required Description
audioFile file (Upload required) Yes -
analysisSeconds text No -

File type parameters need to be uploaded first via POST /upload/audio-key-detector to get filePath, then pass filePath to the corresponding file field.

Response Format

{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
JSON Data: JSON Data

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-audio-key-detector": {
      "name": "audio-key-detector",
      "description": "Detect the musical key of a track",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=audio-key-detector",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

Supports URL file links or Base64 encoding for file parameters.

If you encounter any issues, please contact us at [email protected]