Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

expandRepeats don't work as expected

Aperta
#1,713 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python
Ambito
data

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
2.6k
Fork
459
Merge medio
1g 7h
PR unite (30g)
40

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cuthbertLab/music21

Tutte le issue di cuthbertLab/music21

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.