音訊人工智慧指南

音訊和弦識別

Audio chord recognition is the task of listening to a music recording and writing down which chord is sounding at each moment, such as C:maj from 0.0 to 2.1 seconds, then A:min.

聆聽此指南AI 語音敘述 · ~8 min

本頁閱讀時間 9 分鐘
  1. 概述
  2. 重點摘要
  3. 深入探討
  4. Estimating and checking the chords of one song
  5. 現實世界的實施
  6. 音頻和弦辨識的未來
  7. 付諸實踐
  8. 資料來源與延伸閱讀
  9. 不斷探索
  10. 常見問題

概述

It powers chord-sheet apps, music education and music search, and after more than two decades of research the best systems still label only about two thirds of frames exactly right once rare chord types are included.

重點摘要

  1. Audio chord recognition outputs a time-coded list of chord labels, such as G:maj or E:min, from a music recording.
  2. Classic systems compute a 12-bin chromagram, match frames to chord templates and smooth the result with a hidden Markov model.
  3. A 2019 ISMIR review traces automatic chord recognition to a 1999 paper by Fujishima and describes a shift to neural networks.
  4. McFee and Bello's 2017 model used a 170-chord vocabulary and named the exact chord in 63.6% of frames on 1,217 tracks.
  5. Major chords made up 52.5% of that corpus by duration, so rare chords such as sixths and suspended chords are recognized poorly.
  6. Scores depend on the comparison rule, so results should state whether they measure root, majmin, sevenths or tetrads accuracy.

深入探討

Audio chord recognition, also called automatic chord estimation, takes a recording and produces a time-coded list of chord labels. A typical output reads like a lead sheet with timestamps: G:maj from 0.00 to 1.85 seconds, E:min until 3.70, C:maj until 5.55, and N, meaning no chord, during a drum break. A chord here is a set of pitch classes, the 12 note names regardless of octave, sounding together, described by a root such as G and a quality such as major, minor or dominant seventh. The task sits between full transcription, which writes every note, and key detection, which gives one label for a whole piece.

The classic pipeline has three steps. First the audio is turned into a chromagram, a sequence of 12-number vectors that measure how much energy falls on each pitch class in each short frame. A C major chord should light up C, E and G. Second, each frame is compared with chord templates, idealized chroma patterns for every chord in the vocabulary, or scored by a statistical model. Third, a temporal model smooths the frame-wise guesses, because chords usually last for beats or bars rather than flickering every 50 milliseconds. A hidden Markov model (HMM), which treats the chord as a hidden state that tends to persist and changes with learned probabilities, is the traditional choice, decoded with the Viterbi algorithm to find the most likely chord sequence.

Chordino, released by Matthias Mauch and Chris Cannam as a Vamp audio plugin, is a widely used example of this design. Its companion NNLS Chroma plugin converts the spectrum to a log-frequency scale, tunes and whitens it, and then performs approximate note transcription with non-negative least squares (NNLS), a fitting method that explains the spectrum as a sum of harmonic note shapes with no negative amounts. That cleans up overtones, which otherwise make a C note leak energy into G and E. Separate bass and treble chromagrams help identify the bass note. Chordino matches frames against chord profiles from a dictionary file and smooths them with HMM decoding. The method comes from a 2010 ISMIR paper by Mauch and Simon Dixon on identifying difficult chords.

The field's history is summarized in a 2019 ISMIR review by Johan Pauwels, Ken O'Hanlon, Emilia Gómez and Mark Sandler titled 20 Years of Automatic Chord Recognition from Audio. It traces the task to a 1999 paper by Fujishima and describes a shift from knowledge-based systems, built on music theory and hand-set templates, to data-driven methods, with neural networks now central. The authors argue that many of today's core issues were already raised in that first paper. Shared evaluation rests on hand-annotated corpora such as the Isophonics Beatles collection, whose chord syntax and transcription process are described in Chris Harte's 2010 PhD thesis; that syntax is now the standard way to write chord labels in research.

Deep learning replaced hand-built stages one at a time. In 2016 Filip Korzeniowski and Gerhard Widmer showed that a neural network fed a spectrum with surrounding context could learn chroma vectors that were less noisy than hand-crafted ones, improving recognition with even a simple linear classifier. In 2017 Brian McFee and Juan Pablo Bello trained a convolutional-recurrent network end to end on log-power constant-Q spectra, a frequency representation with bins spaced like musical notes. Their model used a 170-class vocabulary, 12 roots times 14 qualities plus N and X for unrecognized chords, and was also trained to predict the root, bass and active pitch classes as separate outputs. On 1,217 annotated tracks from the Isophonics, Billboard, RWC Pop and MARL collections it gained 4 to 5 percentage points in the hardest sevenths and tetrads categories over earlier convolutional and HMM systems. In 2019 Park and colleagues proposed a bi-directional Transformer for chord recognition, using self-attention to capture long-range context in a single training phase.

The honest measure of progress is sobering. McFee and Bello's best model identified the exact simplified chord, root and quality together, in 63.6% of frames. Their data explain why. By duration, major chords made up 52.5% of the corpus and minor chords 13.6%, while sixth chords were 1.5%, suspended chords 2.5% and minor-major sevenths only 0.03%. Models therefore lean toward major and minor, and they confuse a seventh chord with its plain triad. Out-of-vocabulary chords, mostly power chords and single notes, made up 2.2% of the data and were usually pushed toward major or minor. Simpler evaluations score far higher, because getting the root right or matching three of the notes is much easier than naming the full chord.

Other failure modes come from music itself. Annotators disagree on chord labels, especially for passing chords, implied harmony and dense jazz voicings, so the reference is partly subjective. Strong vocals, distorted guitars and drums blur the chromagram. The standard corpora, such as the Beatles, Billboard and RWC Pop collections, are mostly Western popular music, so other harmonic systems fit the labels poorly. Tuning that is not at standard pitch shifts energy between bins, which is why NNLS Chroma includes a tuning step. Inversions, where a note other than the root is in the bass, are often ignored; McFee and Bello's model predicted the bass but did not output inversions, while the later crema release added inversion tracking.

In practice, running a chord recognizer is cheap. Chordino runs on an ordinary computer inside Sonic Visualiser, and crema returns chord labels with confidence values from a single Python call. Evaluation is standardized through mir_eval, so results are comparable across papers if the vocabulary and comparison rule are stated. The useful habit is to report several scores, such as root, majmin and sevenths, and to listen to low-confidence sections rather than trusting a single accuracy number.

04工作範例

Estimating and checking the chords of one song

  1. 選擇一首您可以憑耳聽力註解,或是擁有已發布和弦註解的歌曲,例如 Isophonics 披頭四收藏中的某個音軌。

  2. 在 Sonic Visualiser 中開啟音訊,並執行 Chordino 外掛程式,以在波形上方取得和弦標籤軌道。

  3. 使用 Harte 語法(例如 A:min 或 D:7),將標籤匯出為包含開始時間、結束時間與和弦的清單。

  4. 將估計值與參考註解載入 mir_eval 中,並計算根音、majmin、七和弦以及分割分數。

  5. 使用 crema ChordModel 重複此步驟,並比較兩個系統在同一首歌上的分數。

  6. 聆聽兩個系統與參考標準不一致的段落,並記錄原因是由於七和弦、轉位還是經過和弦。

它顯示了什麼

一首歌的兩組分數與簡短的錯誤清單。根音分數應明顯高於七和弦分數;如果沒有,請檢查參考值和估計值是否使用相同的時間軸與標籤語法。

現實世界的實施

使用 Chordino 為歌曲草擬和弦圖表。Chordino 是由 Matthias Mauch 與 Chris Cannam 所開發的免費 Vamp 外掛程式,可在 Sonic Visualiser 或 Audacity 中執行,並透過 HMM 平滑逐影格的和弦猜測。

執行 crema Python 套件的 ChordModel(建構於 McFee 和 Bello 2017 年的結構化模型上),以取得包含開始時間、持續時間、信賴值與轉位的和弦標籤表。

使用 mir_eval 針對人工註解來為和弦辨識器計分。mir_eval 提供根音、majmin、七和弦、四音和弦,以及按片段持續時間加權的 MIREX 比較,外加過度分割與分割不足的分數。

在 Isophonics 披頭四參考註解上進行訓練與測試。這些註解以 Harte 和弦語法提供和弦、調性、拍子與結構標籤,並且至今仍是標準的基準收藏。

將 Korzeniowski 與 Widmer 2016 年深度色度擷取器所學得的色度向量輸入簡單的分類器中。作者發現,這種方法在和弦辨識上勝過手工打造的色度特徵。

音頻和弦辨識的未來

The 2019 review by Pauwels and colleagues argues that many core issues raised in Fujishima's 1999 paper are still relevant, and it closes by naming directions for future research. Large-vocabulary recognition is the clearest gap. McFee and Bello wrote in 2017 that extending models to extended chords would need larger annotated corpora than were then available, and their class statistics show why, with some chord qualities under 1% of the data. Inversions are another direction: their 2017 model predicted bass notes without outputting inversions, and the later crema model added inversion tracking with an effective vocabulary of 602 classes. Architectures have moved from HMMs to recurrent networks to Transformers such as the 2019 bi-directional Transformer for chord recognition, which uses attention to capture long-range context. How much further accuracy can rise when reference annotations themselves disagree is an open question; McFee and Bello note that chord annotation is known to be subjective.

付諸實踐

為什麼這很重要

  • 交通與覆蓋範圍. 它透過轉錄、旁白和語音介面提高了可訪問性。
  • 成本與預算. 媒體團隊可以用更少的預算更快地交付精美的音訊。
  • 速度與規模. 面向客戶的系統可以處理更大規模的語音互動。

留意

  • 如果未徵得同意,語音濫用和冒充風險就會增加。
  • 由於口音、方言或嘈雜的環境,準確性可能會下降。
  • 如果沒有明確的標籤,合成音訊可能會被誤認為是真實的語音。

後續步驟

  1. 獲得語音捕獲、克隆和重用的明確同意。
  2. 測試不同揚聲器和背景條件下的品質。
  3. 定義人員必須審查或批准輸出的時間。
  4. 標記合成音訊並保留來源記錄以供問責。

資料來源與延伸閱讀

  1. ISMIR 2019 (Zenodo)自動音訊和弦辨識 20 年
  2. ISMIR 2017用於大型詞彙和弦辨識的結構化訓練
  3. arXiv (ISMIR 2016)和弦辨識的特徵學習:深度色度提取器
  4. arXiv (ISMIR 2019)用於音樂和弦辨識的雙向 Transformer
  5. Isophonics, Queen Mary University of LondonNNLS 色度與 Chordino
  6. mir_eval documentationmir_eval.chord
  7. crema documentationcrema 模型參考
  8. Isophonics參考標註:披頭士樂團

不斷探索

免費電子報

獲取每日 AI 簡報

每個工作日上午提供三則經過驗證的 AI 新聞,以淺顯易懂的英文撰寫。永久免費,無廣告。

每個工作日一封電子郵件。一鍵取消訂閱。我們絕不出售或分享您的地址。

測試一下自己

參加音訊和弦辨識測驗

每個答案皆有即時回饋,通過課程後可獲得具備可驗證 ID 的可分享證書。

開始測驗

支持免費的 AI 教育。AI Understanding 是一個 501(c)(3) 非營利組織——絕無廣告,絕無付費牆。 捐款

常見問題

什麼是音頻和弦辨識?

音訊和弦辨識是一項任務,要求聆聽音樂錄音並記錄下每個時刻正在響起的和弦,例如從 0.0 秒到 2.1 秒為 C:maj,接著是 A:min。它驅動著和弦譜應用程式、音樂教育與音樂搜尋,經過二十多年的研究,一旦納入罕見的和弦類型,最佳系統仍只能精確標註約三分之二的幀。

音頻和弦辨識系統的輸出是什麼?

和弦辨識會產生和弦標籤(例如 C、Am、G7)以及歌曲的開始時間和結束時間。

哪個功能對於和弦辨識最重要?

色度向量將頻譜折疊為 12 個音級,直接暴露定義和弦的音符。

為什麼在和弦辨識之前經常應用和聲打擊樂分離?

消除打擊樂能量會留下更清晰的音調內容,從而改善和弦使用的色度特徵。

隱馬可夫模型傳統上在和弦辨識中扮演什麼角色?

HMM 對哪些和弦傾向於遵循哪些和弦進行建模,將雜訊的幀級預測平滑為穩定的進行。

微小的調音差異會對基於色度的和弦辨識產生什麼影響?

ISMIR 研究解釋說,調音差異可能會將能量轉移到相鄰的音軌中,並導致相似和弦之間的混淆,例如平行的大調/小調模式。