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

Add xmlID as a property of at least note and rest objects when parsing xml/mei scores

Aperta
#1,670 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python, xml
Ambito
data

Direzione di ricerca

Start with the note.Note and note.Rest classes and the base object class that defines priority and sortTuple(), then check how the MusicXML and MEI parsers set element ids. Decide whether xmlID is a new string attribute or reuses priority, which the issue leaves open. Done means Note().xmlID returns None by default and the parsed id for notes and rests from an MEI or MusicXML file, with tests covering both cases.

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

Descrizione

enhancement

Motivation

Adding xmlID as a property would be useful to people who want to be able to go between music21 analysis and the score itself easily. This would greatly facilitate taking analysis done with music21 and encoding it into the symbolic notation file itself. This would be similar to how scores parsed in music21 have a "priority" property which is very useful when analyzing kern scores and wanting to go between music21 and the symbolic notation file easily.

Feature summary
Add xmlID as a property on objects of potentially all types, but at the very least notes and rests. Alternatively, since this only applies to xml and mei scores and those file types do not make use of the "priority" property, priority could serve double duty as the xml id property name. Though I believe priority is currently ints and xml ids would have to be strings, and xml ids can't be used in the sort order (object.sortTuple()) like priority can.

Proposed implementation
n = note.Note()
print(n.xmlID) # -> should print "None" for notes that aren't from an xml or mei file (or are but don't have the property), and the xml id string otherwise

Optionally, describe the implementation or the interface, in code or pseudocode.

Intent

I could potentially submit this pr myself if there is interest for it.
[√] I plan on implementing this myself.
[ ] I am willing to pay to have this feature added.
[ ] I am starting a discussion with the hope that community members will volunteer their time to create this. I understand that individuals work on features of interest to them and that this feature may never be implemented.

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.