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

expandRepeats don't work as expected

Đang mở
#1,713 3 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
22/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
data

Hướng nghiên cứu

The bug is in expandRepeats() on a score parsed from MusicXML with converter.parse, so start from that method and how it expands repeat markers. The attached snippet is not runnable as posted, so first rebuild it with a small 10-measure stream that has a repeat over measures 5 to 10 and check whether measures are duplicated. Done means expanding that stream gives each measure the expected number of times, and the issue's expected output is confirmed. The thread has no maintainer answer for over 300 days, so expect little help.

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

Mô tả

music21 version

9.8.7

Problem summary

I have got a musicxml file with 10 measures one repetition from 5 to 10.
I parse my file with convert.parse and then expandRepeats
music21 repeat from measure repeat 5 to 10 correctly and then do another 1 to 10 - 5 to 10

Paste minimal code example here. Most issues can be reproduced with just a few elements.
Attach external files only after attempting to reproduce using a simple stream.
 score = converter.parse(filepath, format='musicxml')
    score = score.expandRepeats()
    measures = score.recurse().getElementsByClass('Measure')
    score.write("musicxml", fp="file.xml")

Expected vs. actual behavior

Expected : Not repeat one more time

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.