当前位置: 首页>>代码示例>>Python>>正文


Python contour.Contour类代码示例

本文整理汇总了Python中contour.contour.Contour的典型用法代码示例。如果您正苦于以下问题:Python Contour类的具体用法?Python Contour怎么用?Python Contour使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Contour类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_subsets_normal

def test_subsets_normal():
    cseg = Contour([0, 3, 1, 4, 2])
    assert cseg.subsets_normal(4) == {(0, 1, 3, 2): [[0, 1, 4, 2]],
                                      (0, 2, 1, 3): [[0, 3, 1, 4]],
                                      (0, 2, 3, 1): [[0, 3, 4, 2]],
                                      (0, 3, 1, 2): [[0, 3, 1, 2]],
                                      (2, 0, 3, 1): [[3, 1, 4, 2]]}
开发者ID:mdsmus,项目名称:MusiContour,代码行数:7,代码来源:test_contour.py

示例2: test_subsets_prime

def test_subsets_prime():
    cseg = Contour([0, 3, 1, 4, 2])
    assert cseg.subsets_prime(4) == {(0, 1, 3, 2): [[0, 1, 4, 2]],
                                     (0, 2, 1, 3): [[0, 3, 1, 4]],
                                     (0, 2, 3, 1): [[0, 3, 4, 2]],
                                     (0, 3, 1, 2): [[0, 3, 1, 2]],
                                     (1, 3, 0, 2): [[3, 1, 4, 2]]}
开发者ID:mdsmus,项目名称:MusiContour,代码行数:7,代码来源:test_contour.py

示例3: test_comparison_matrix_2

def test_comparison_matrix_2():
    cseg = Contour([1, 2, 3, 0, 3, 1])
    assert cseg.comparison_matrix() == [[1, 2, 3, 0, 3, 1],
                                        [0, 1, 1, -1, 1, 0],
                                        [-1, 0, 1, -1, 1, -1],
                                        [-1, -1, 0, -1, 0, -1],
                                        [1, 1, 1, 0, 1, 1],
                                        [-1, -1, 0, -1, 0, -1],
                                        [0, 1, 1, -1, 1, 0]]
开发者ID:mdsmus,项目名称:MusiContour,代码行数:9,代码来源:test_contour.py

示例4: voice_contour_reduction

def voice_contour_reduction(piece_path, voice):
    """Retorna a redução de contornos de Morris a partir de uma voz de
    uma peça.

    >>> voice_contour_reduction('bach/bwv7.7', 'Soprano')
    [< 0 2 1 >, 4]
    """

    piece = corpus.parse(piece_path)
    voice_notes = piece.getElementById(voice).flat.notes
    voice_freq = [n.frequency for n in voice_notes]
    voice_contour = Contour(voice_freq).translation()
    return voice_contour.reduction_algorithm()
开发者ID:mdsmus,项目名称:contornos-corais-bach,代码行数:13,代码来源:trabalho-music21.py

示例5: test_rotated_representatives_2

def test_rotated_representatives_2():
    cseg = Contour([0, 3, 1, 2])
    assert cseg.rotated_representatives() == [[0, 2, 1, 3], [0, 3, 1, 2],
                                              [1, 2, 0, 3], [1, 3, 0, 2],
                                              [2, 0, 3, 1], [2, 1, 3, 0],
                                              [3, 0, 2, 1], [3, 1, 2, 0]]
开发者ID:mdsmus,项目名称:MusiContour,代码行数:6,代码来源:test_contour.py

示例6: test_adjacency_series_vector_2

def test_adjacency_series_vector_2():
    cseg = Contour([1, 2, 3, 0, 3, 1])
    assert cseg.adjacency_series_vector() == [3, 2]
开发者ID:mdsmus,项目名称:MusiContour,代码行数:3,代码来源:test_contour.py

示例7: test_all_rotations_2

def test_all_rotations_2():
    cseg = Contour([0, 3, 1, 2])
    assert cseg.all_rotations() == [[0, 3, 1, 2], [3, 1, 2, 0], [1, 2, 0, 3],
                                    [2, 0, 3, 1], [0, 3, 1, 2]]
开发者ID:mdsmus,项目名称:MusiContour,代码行数:4,代码来源:test_contour.py

示例8: test_prime_form_marvin_laprade_2

def test_prime_form_marvin_laprade_2():
    cseg = Contour([5, 7, 9, 1])
    assert cseg.prime_form_marvin_laprade() == [0, 3, 2, 1]
开发者ID:mdsmus,项目名称:MusiContour,代码行数:3,代码来源:test_contour.py

示例9: test_prime_form_marvin_laprade_5

def test_prime_form_marvin_laprade_5():
    cseg = Contour([0, 1, 2, 1, 2])
    assert cseg.prime_form_marvin_laprade() == [[0, 1, 3, 2, 4], [0, 2, 4, 1, 3]]
开发者ID:mdsmus,项目名称:MusiContour,代码行数:3,代码来源:test_contour.py

示例10: test_retrograde

def test_retrograde():
    cseg = Contour([1, 4, 9, 9, 2, 1])
    assert cseg.retrograde() == [1, 2, 9, 9, 4, 1]
开发者ID:mdsmus,项目名称:MusiContour,代码行数:3,代码来源:test_contour.py

示例11: test_translation

def test_translation():
    cseg = Contour([1, 4, 9, 9, 2, 1])
    assert cseg.translation() == [0, 2, 3, 3, 1, 0]
开发者ID:mdsmus,项目名称:MusiContour,代码行数:3,代码来源:test_contour.py

示例12: test_ri_identity_test_1

def test_ri_identity_test_1():
    cseg = Contour([0, 1, 3, 2])
    assert cseg.ri_identity_test() == False
开发者ID:mdsmus,项目名称:MusiContour,代码行数:3,代码来源:test_contour.py

示例13: test_ri_identity_test

def test_ri_identity_test():
    cseg = Contour([1, 0, 3, 2])
    assert cseg.ri_identity_test() == True
开发者ID:mdsmus,项目名称:MusiContour,代码行数:3,代码来源:test_contour.py

示例14: test_segment_class_1

def test_segment_class_1():
    cseg = Contour([2, 1, 4])
    assert cseg.segment_class() == (3, 2, [0, 2, 1], False)
开发者ID:mdsmus,项目名称:MusiContour,代码行数:3,代码来源:test_contour.py

示例15: test_segment_class_2

def test_segment_class_2():
    cseg = Contour([3, 1, 0])
    assert cseg.segment_class() == (3, 1, [0, 1, 2], True)
开发者ID:mdsmus,项目名称:MusiContour,代码行数:3,代码来源:test_contour.py


注:本文中的contour.contour.Contour类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。