Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

method `ConcreteScale.deriveByDegree` not working for `scale.MelodicMinorScale` for some degrees

Đang mở
#1,649 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
50/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
tooling

Hướng nghiên cứu

Start by running the reproduction in the issue: scale.MelodicMinorScale('c').deriveByDegree(6, 'c'), which raises IntervalNetworkException: could not find any edges. The failure is in the interval network that ConcreteScale.deriveByDegree builds, so read the music21 scale module's intervalNetwork code and the melodic minor definition. Done means degrees 6 and 7 return pitches without raising, and the existing scale tests still pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

music21 version

9.1.0

Problem summary

The method ConcreteScale.deriveByDegree is not working for scale.MelodicMinorScale for some degrees (e.g. 6, and 7).

Steps to reproduce

>>> scale.MelodicMinorScale('c').deriveByDegree(6, 'c')

...
music21.scale.intervalNetwork.IntervalNetworkException: could not find any edges

All other scales and degrees seem to work as expected.

for s in [
    scale.MelodicMinorScale,
    scale.MinorScale,
    scale.MajorScale,
    scale.HarmonicMinorScale,
    scale.OctatonicScale,
    scale.WholeToneScale,
    scale.ChromaticScale,
]:
    sc = s('c')
    print(sc.name)
    print([p.name for p in sc.pitches])
    for i in range(1, len(sc.pitches)):
        try:
            derived1 = sc.deriveByDegree(i, "c")
            pitches = [p.name for p in derived1.pitches]
        except Exception as e:
            pitches = f"Exception: {e}"
        print(i, pitches)

Expected vs. actual behavior

Actual behaviour: see output on C melodic minor for degrees 6 and 7.

C melodic minor
['C', 'D', 'E-', 'F', 'G', 'A', 'B', 'C']
1 ['C', 'D', 'E-', 'F', 'G', 'A', 'B', 'C']
2 ['B-', 'C', 'D-', 'E-', 'F', 'G', 'A', 'B-']
3 ['A', 'B', 'C', 'D', 'E', 'F#', 'G#', 'A']
4 ['G', 'A', 'B-', 'C', 'D', 'E', 'F#', 'G']
5 ['F', 'G', 'A-', 'B-', 'C', 'D', 'E', 'F']
6 Exception: could not find any edges
7 Exception: could not find any edges
C minor
['C', 'D', 'E-', 'F', 'G', 'A-', 'B-', 'C']
1 ['C', 'D', 'E-', 'F', 'G', 'A-', 'B-', 'C']
2 ['B-', 'C', 'D-', 'E-', 'F', 'G-', 'A-', 'B-']
3 ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'A']
4 ['G', 'A', 'B-', 'C', 'D', 'E-', 'F', 'G']
5 ['F', 'G', 'A-', 'B-', 'C', 'D-', 'E-', 'F']
6 ['E', 'F#', 'G', 'A', 'B', 'C', 'D', 'E']
7 ['D', 'E', 'F', 'G', 'A', 'B-', 'C', 'D']
C major
['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C']
1 ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C']
2 ['B-', 'C', 'D', 'E-', 'F', 'G', 'A', 'B-']
3 ['A-', 'B-', 'C', 'D-', 'E-', 'F', 'G', 'A-']
4 ['G', 'A', 'B', 'C', 'D', 'E', 'F#', 'G']
5 ['F', 'G', 'A', 'B-', 'C', 'D', 'E', 'F']
6 ['E-', 'F', 'G', 'A-', 'B-', 'C', 'D', 'E-']
7 ['D-', 'E-', 'F', 'G-', 'A-', 'B-', 'C', 'D-']
C harmonic minor
['C', 'D', 'E-', 'F', 'G', 'A-', 'B', 'C']
1 ['C', 'D', 'E-', 'F', 'G', 'A-', 'B', 'C']
2 ['B-', 'C', 'D-', 'E-', 'F', 'G-', 'A', 'B-']
3 ['A', 'B', 'C', 'D', 'E', 'F', 'G#', 'A']
4 ['G', 'A', 'B-', 'C', 'D', 'E-', 'F#', 'G']
5 ['F', 'G', 'A-', 'B-', 'C', 'D-', 'E', 'F']
6 ['E', 'F#', 'G', 'A', 'B', 'C', 'D#', 'E']
7 ['D-', 'E-', 'F-', 'G-', 'A-', 'B--', 'C', 'D-']
C Octatonic
['C', 'D', 'E-', 'F', 'G-', 'A-', 'A', 'B', 'C']
1 ['C', 'D', 'E-', 'F', 'G-', 'A-', 'A', 'B', 'C']
2 ['B-', 'C', 'D-', 'E-', 'F-', 'G-', 'G', 'A', 'B-']
3 ['A', 'B', 'C', 'D', 'E-', 'F', 'G-', 'A-', 'A']
4 ['G', 'A', 'B-', 'C', 'D-', 'E-', 'F-', 'G-', 'G']
5 ['G-', 'A-', 'A', 'B', 'C', 'D', 'E-', 'F', 'G-']
6 ['F-', 'G-', 'G', 'A', 'B-', 'C', 'D-', 'E-', 'F-']
7 ['E-', 'F', 'G-', 'A-', 'A', 'B', 'C', 'D', 'E-']
8 ['D-', 'E-', 'F-', 'G-', 'G', 'A', 'B-', 'C', 'D-']
C Whole tone
['C', 'D', 'E', 'F#', 'G#', 'A#', 'B#']
1 ['C', 'D', 'E', 'F#', 'G#', 'A#', 'B#']
2 ['B-', 'C', 'D', 'E', 'F#', 'G#', 'A#']
3 ['A-', 'B-', 'C', 'D', 'E', 'F#', 'G#']
4 ['G-', 'A-', 'B-', 'C', 'D', 'E', 'F#']
5 ['F-', 'G-', 'A-', 'B-', 'C', 'D', 'E']
6 ['D', 'E', 'F#', 'G#', 'A#', 'B#', 'D']
C Chromatic
['C', 'C#', 'D', 'E-', 'E', 'F', 'F#', 'G', 'A-', 'A', 'B-', 'B', 'C']
1 ['C', 'C#', 'D', 'E-', 'E', 'F', 'F#', 'G', 'A-', 'A', 'B-', 'B', 'C']
2 ['B', 'C', 'C#', 'D', 'E-', 'E', 'F', 'F#', 'G', 'A-', 'A', 'B-', 'B']
3 ['B-', 'B', 'C', 'C#', 'D', 'E-', 'E', 'F', 'F#', 'G', 'A-', 'A', 'B-']
4 ['A', 'B-', 'B', 'C', 'C#', 'D', 'E-', 'E', 'F', 'F#', 'G', 'A-', 'A']
5 ['G#', 'A', 'B-', 'B', 'C', 'C#', 'D', 'E-', 'E', 'F', 'F#', 'G', 'A-']
6 ['G', 'A-', 'A', 'B-', 'B', 'C', 'C#', 'D', 'E-', 'E', 'F', 'F#', 'G']
7 ['F#', 'G', 'A-', 'A', 'B-', 'B', 'C', 'C#', 'D', 'E-', 'E', 'F', 'F#']
8 ['F', 'F#', 'G', 'A-', 'A', 'B-', 'B', 'C', 'C#', 'D', 'E-', 'E', 'F']
9 ['E', 'F', 'F#', 'G', 'A-', 'A', 'B-', 'B', 'C', 'C#', 'D', 'E-', 'E']
10 ['E-', 'E', 'F', 'F#', 'G', 'A-', 'A', 'B-', 'B', 'C', 'C#', 'D', 'E-']
11 ['D', 'E-', 'E', 'F', 'F#', 'G', 'A-', 'A', 'B-', 'B', 'C', 'C#', 'D']
12 ['C#', 'D', 'E-', 'E', 'F', 'F#', 'G', 'A-', 'A', 'B-', 'B', 'C', 'C#']
Ngôn ngữ chính
Python
Star
2.6k
Fork
459
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
40

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cuthbertLab/music21

Tất cả issue của cuthbertLab/music21

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.