當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。