← 返回
未分类 中文

Chord Analyzer

Analyze music audio files to extract chord progressions, key signature, tempo, and song structure. Use when user wants to identify chords, analyze a song's h...
分析音乐音频文件,提取和弦进行、调号、节拍及歌曲结构。适用于用户需要识别和弦、分析歌曲和声特征等场景。
ctwww ctwww 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 447
下载
💾 0
安装
1
版本
#latest

概述

Chord Analyzer Skill

Analyze music audio files to extract chord progressions, key signature, tempo, and song structure.

When to Use

USE this skill when:

  • User wants to analyze a song's chords and harmony
  • "What are the chords in this song?"
  • "Analyze this audio file"
  • "Extract the chord progression"
  • "What key is this song in?"
  • User provides an audio file path and asks for musical analysis

When NOT to Use

DON'T use this skill when:

  • Only wants general music info (lyrics, artist) → use web search
  • Wants to generate music → use music generation skills
  • Needs professional-grade transcription → recommend specialized software (Chordify, Hookpad)
  • Requires detailed instrument separation → use dedicated source separation tools

Supported Formats

  • Audio: mp3, wav, m4a, flac, ogg
  • Duration: Works best for songs under 5 minutes

Installation

First time use requires installing dependencies:

pip3 install librosa numpy scipy scikit-learn soundfile

Usage

Basic Analysis

# Analyze an audio file
python3 chord_analyzer.py

# Edit the script to change the audio path
# Default: /Users/chentiewen/Music/网易云音乐/example.mp3

Script Integration

Copy the chord_analyzer.py script to your workspace and modify the audio_path variable:

audio_path = "/path/to/your/song.mp3"
result = analyze_audio(audio_path)

Output

The analyzer provides:

  1. Key Signature: Detected musical key (e.g., C, F#m, G)
  2. Tempo: Speed in BPM with rhythm classification
  3. Chord Progression: Complete chord sequence with timestamps
  4. Chord Statistics: Most frequently used chords
  5. Song Structure: Intro/Verse/Outro segmentation (basic)

Sample Output

调性: F#m
速度: 123.0 BPM
节奏: 快板 (Allegro)

和弦走向:
F#mdim → A → D → Bm → E → A → D → Bm → E ...

主要和弦:
  A: 15次 (20.3%)
  E: 14次 (18.9%)
  D: 12次 (16.2%)

How It Works

  1. Load Audio: Uses librosa.load() to read audio at 22.05kHz
  2. Extract Chroma: Computes chroma features (pitch class profiles) using STFT
  3. Detect Key: Analyzes chroma energy across all 12 keys (major + minor)
  4. Track Tempo: Uses librosa.beat.beat_track() for tempo detection
  5. Analyze Chords: Samples chroma at measure boundaries and matches against chord templates
  6. Merge & Simplify: Combines consecutive identical chords

Limitations

  • Accuracy: Chord detection is approximated; not professional-grade
  • Complexity: Struggles with heavily layered or distorted music
  • Structure: Simple segmentation (not verse/chorus detection)
  • Melody: Does not extract melodic lines or instrument parts
  • Chord Extensions: Detects basic triads (major, minor, diminished), not 7th/9th chords

For Complete Transcription

For professional music transcription, recommend:

  • Chordify: https://chordify.net (online chord detection)
  • Hookpad: https://www.hooktheory.com/hookpad (theory + chords)
  • MuseScore: https://musescore.org (manual transcription)
  • Capo: https://capoapp.com (slow down + chord detection)

Notes

  • Analysis takes ~10-30 seconds depending on song length
  • Best results with clear, non-distorted audio
  • Works best for pop/rock/folk styles with clear harmony
  • Not suitable for atonal, experimental, or heavily percussive music

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 16:39 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

design-media

Openai Whisper

steipete
使用 Whisper CLI 进行本地语音转文字(无需 API 密钥)
★ 331 📥 93,759
design-media

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 429 📥 116,905
design-media

Video Frames

steipete
使用 ffmpeg 从视频中提取帧或短片。
★ 134 📥 52,862