zoukankan      html  css  js  c++  java
  • 基于COCHONUT做和弦识别

    论文为:COCHONUT: Recognizing Complex Chords From MIDI Guitar Sequences
    出处:international symposium/conference on music information retrieval(ISMIR) 2008
     
    自动和弦辨别的难点:
    strong context dependency and the large number of possible combinations of the intervals which the chords are made of, specially when dealing with dissonances,and suspended chords.
    论文提出一个新的方法COCHONUT (Complex Chords Nutting)来识别midi guitar的和弦,基于contextual harmonic information + decision theory + optimization + pattern matching + rule-based recognition
    COCHONUT的目标不仅是辨认1,3,5音,复杂音符,4音符,5音符,6音符和弦也能被辨认出来。
     
    代码中是基于musicXML来进行解析,因此可以得到歌曲大小调标志(后续根据上下文来增强识别和弦时需要用到)
    第一步,a segmentation algorithm判断出最可能的和弦变化的点,这一步做分割。主要函数
    ,segments是一个记录了n个segment的list,每一个segment记录了一段共用和弦的时间段。划分原理大概是基于note的数量的。这里
     
    第二步,utility function判别每个segmentation的和弦;

    这里构建了一个weight权重数组(12音阶),统计出该段中的音符值次数(权重比例),将该权重数组与事先定义好的和弦template一起匹配,得到每个和弦的得分,并得出最佳得分的和弦。

    templates = [{'name': 'maj', 'pattern': [0, 4, 7]},
    {'name': 'minor', 'pattern': [0, 3, 7]},
    {'name': 'diminished', 'pattern': [0, 3, 6]},
    {'name': '-5', 'pattern': [0, 4, 6]},
    {'name': 'aug', 'pattern': [0, 4, 8]},
    {'name': 'sus4', 'pattern': [0, 5, 7]},
    {'name': 'sus2', 'pattern': [0, 2, 7]},
    {'name': 'maj7', 'pattern': [0, 4, 7, 11]},
    {'name': 'maj7+5', 'pattern': [0, 4, 8, 11]},
    {'name': 'dom', 'pattern': [0, 4, 7, 10]},
    {'name': 'add9', 'pattern': [0, 4, 7, 14]},
    {'name': '1/2dim', 'pattern': [0, 3, 6, 10]},
    {'name': 'dim7', 'pattern': [0, 3, 6, 9]},
    {'name': 'min7', 'pattern': [0, 3, 7, 10]},
    {'name': 'min/maj7', 'pattern': [0, 3, 7, 11]},
    {'name': '7+5', 'pattern': [0, 4, 8, 10]},
    {'name': '7-5', 'pattern': [0, 4, 6, 10]},
    {'name': '7sus4', 'pattern': [0, 5, 7, 10]},
    {'name': 'maj6', 'pattern': [0, 4, 7, 9]},
    {'name': 'minor6', 'pattern': [0, 3, 7, 9]},
    {'name': 'madd9', 'pattern': [0, 3, 7, 14]},
    {'name': 'm6/9', 'pattern': [0, 3, 7, 9, 14]},
    {'name': '6add9', 'pattern': [0, 4, 7, 9, 14]},
    {'name': '7/6', 'pattern': [0, 4, 7, 9, 10]},
    {'name': '9', 'pattern': [0, 4, 7, 10, 14]},
    {'name': '7/13', 'pattern': [0, 4, 7, 10, 21]},
    {'name': '9-5', 'pattern': [0, 4, 6, 10, 14]},
    {'name': '9+5', 'pattern': [0, 4, 8, 10, 14]},
    {'name': 'min9', 'pattern': [0, 3, 7, 10, 14]},
    {'name': '7-9', 'pattern': [0, 4, 7, 10, 13]},
    {'name': '7+9', 'pattern': [0, 4, 7, 10, 15]},
    {'name': 'maj9', 'pattern': [0, 4, 7, 11, 14]},
    {'name': 'min/maj9', 'pattern': [0, 3, 7, 11, 14]},
    {'name': '9/6', 'pattern': [0, 4, 7, 9, 10, 14]},
    {'name': 'maj11', 'pattern': [0, 4, 7, 11, 14, 17]},
    {'name': '9+11', 'pattern': [0, 4, 7, 10, 14, 18]},
    {'name': '11', 'pattern': [0, 4, 7, 10, 14, 17]},
    {'name': '11-9', 'pattern': [0, 4, 7, 10, 13, 17]},
    {'name': 'aug11', 'pattern': [0, 4, 7, 10, 14, 18]},
    {'name': 'min11', 'pattern': [0, 3, 7, 10, 14, 17]},
    {'name': 'min13', 'pattern': [0, 3, 7, 10, 14, 17, 21]},
    {'name': 'maj13', 'pattern': [0, 4, 7, 11, 14, 17, 21]},
    {'name': '13', 'pattern': [0, 4, 7, 10, 14, 17, 21]},
    {'name': '13-9', 'pattern': [0, 4, 7, 10, 13, 17, 21]},
    {'name': '13-9-6', 'pattern': [0, 4, 6, 10, 13, 17, 21]},
    {'name': '13-9+11', 'pattern': [0, 4, 7, 10, 13, 18, 21]},
    {'name': '13+11', 'pattern': [0, 4, 7, 10, 14, 18, 21]},
    {'name': '13b', 'pattern': [0, 4, 7, 10, 14, 17, 20]}]
     

    接下来,把前后相关的segments和调式一起结合起来,从上下文的角度来增强和弦挑选的准确性。

     大调和小调的区别处理

    事先定义好的和弦走向转换图

    第三步,graph is built表示出最可能的和弦整体图,A rule base containing common chord sequences patterns in jazz harmony is used to solve ambiguous cases.
     
     
     
     
  • 相关阅读:
    (简单) POJ 3414 Pots,BFS+记录路径。
    (简单) POJ 3087 Shuffle'm Up,枚举。
    (简单) POJ 3126 Prime Path,BFS。
    (简单) POJ 1426 Find The Multiple,BFS+同余。
    (简单) POJ 3279 Fliptile,集合枚举。
    (简单) POJ 1278 Catch That Cow,回溯。
    (简单) POJ 2251 Dungeon Master,BFS。
    (简单) POJ 1321 棋盘问题,回溯。
    回溯---输出二叉树中所有从根到叶子的路径
    回溯---在矩阵中寻找字符串
  • 原文地址:https://www.cnblogs.com/punkcure/p/8324198.html
Copyright © 2011-2022 走看看