音频人工智能指南

音频和弦识别

音频和弦识别是听取音乐录音并记录每一时刻正在响的和弦的任务,例如从0.0到2.1秒写下C:maj,然后是A:min。

听听这个指南AI叙述 · ~8 min

在本页阅读时间 9 分钟
  1. 概述
  2. 主要要点
  3. 深入探讨
  4. 估计并检查一首歌的和弦
  5. 现实世界的实施
  6. 音频和弦识别的未来
  7. 付诸实践
  8. 资料来源与延伸阅读
  9. 不断探索
  10. 常见问题

概述

它驱动和弦表应用、音乐教育和音乐搜索,在经过二十多年研究后,最好的系统仍然只能准确标记大约三分之二的帧,尤其是当包含稀有和弦类型时。

主要要点

  1. 音频和弦识别输出一个时间编码的和弦标签列表,例如从音乐录音中得到G:maj或E:min。
  2. 经典系统计算12-bin色谱图,将帧匹配到和弦模板,并用隐马尔可夫模型平滑结果。
  3. 2019年的ISMIR综述追溯了自动和弦识别到1999年的Fujishima论文,并描述了向神经网络的转变。
  4. McFee和Bello的2017模型使用170个和弦词汇,在1,217首曲目中以63.6%的帧准确命名确切和弦。
  5. 主和弦在该语料库中按持续时间占比52.5%,因此像六度和挂留和弦等稀有和弦识别效果较差。
  6. 分数取决于比较规则,因此结果应说明它们测量的是根音、主/小调、七度还是四和弦的准确率。

深入探讨

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工作示例

估计并检查一首歌的和弦

  1. 选择一首你能凭耳朵标注或已公开和弦注释的歌曲,例如 Isophonics 披头士合集中的一首曲目。

  2. 在 Sonic Visualiser 中打开音频并运行 Chordino 插件,以获得波形上的和弦标签轨道。

  3. 将标签导出为起始时间、结束时间和和弦的列表,使用 Harte 语法,例如 A:min 或 D:7。

  4. 将估计结果和参考注释加载到 mir_eval 并计算根音、主/小、七和弦和分割得分。

  5. 使用 crema ChordModel 重复上述步骤,并比较同一首歌的两套系统得分。

  6. 聆听两套系统与参考不一致的段落,记录原因是七和弦、倒置还是过渡和弦。

它显示了什么

一首歌的两套得分和简短错误列表。根音得分应明显高于七和弦得分;若不是,请检查参考和估计使用相同的时间和标签语法。

现实世界的实施

为一首歌曲草拟和弦图,使用 Chordino——Matthias Mauch 和 Chris Cannam 开发的免费 Vamp 插件,在 Sonic Visualiser 或 Audacity 内运行,并用 HMM 平滑帧级和弦猜测。

运行 crema Python 包的 ChordModel,基于 McFee 和 Bello 2017 年的结构化模型,获取带起始时间、持续时间和置信度的和弦标签表,包括倒置。

使用 mir_eval 对手工注释进行和弦识别器评分,提供根音、主/小、七和弦、四和弦和 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 研究解释说,调音差异会将能量移动到相邻的频箱,从而导致相似和弦之间的混淆,例如平行的大调/小调模式。