MusicXML import doesn't read `<midi-instrument>` changes in `<sound>`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
Línea de trabajo
Start with SoundTagMixin.setSound in musicxml/xmlSoundParser.py, which currently handles only tempo, and with where the importer reads midi-instrument from score-part. Reproduce with the XML in the issue and check whether a sound inside a measure or direction is reached at all. The issue leaves open whether the change should become a new Instrument or another record, so settle that with the maintainers first. Done means the example yields program 73 at offset 4.0 and the related score-instrument case (#1696) is not made worse.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
music21 version
10.5.0
Problem summary
A <sound> element can contain a <midi-instrument> that changes a part's program partway through, for example a doubler switching from violin to flute. The importer only reads <midi-instrument> from the <score-part>, so the whole part keeps its first program.
Steps to reproduce
from music21 import converter, instrument
xml = '''<score-partwise version="4.0">
<part-list><score-part id="P1"><part-name>Music</part-name>
<score-instrument id="P1-I1"><instrument-name>Doubler</instrument-name></score-instrument>
<midi-instrument id="P1-I1"><midi-program>41</midi-program></midi-instrument>
</score-part></part-list>
<part id="P1">
<measure number="1">
<attributes><divisions>1</divisions></attributes>
<note><pitch><step>C</step><octave>4</octave></pitch><duration>4</duration><type>whole</type></note>
</measure>
<measure number="2">
<sound><midi-instrument id="P1-I1"><midi-program>74</midi-program></midi-instrument></sound>
<note><pitch><step>D</step><octave>4</octave></pitch><duration>4</duration><type>whole</type></note>
</measure>
</part>
</score-partwise>'''
parsed = converter.parse(xml, format='musicxml')
print([(float(i.getOffsetInHierarchy(parsed)), i.instrumentName, i.midiProgram)
for i in parsed.recurse().getElementsByClass(instrument.Instrument)])
Expected vs. actual behavior
Expected a second instrument, or some other record of the change, with program 73 at offset 4.0. Actual:
[(0.0, 'Doubler', 40)]
More information
Exporters usually write the change inside a direction, next to the printed cue, for example <direction><direction-type><words>Flute</words></direction-type><sound><midi-instrument id="P1-I1"><midi-program>74</midi-program></midi-instrument></sound></direction>. That's ignored too: SoundTagMixin.setSound in musicxml/xmlSoundParser.py only handles tempo.
Related: #1696, where the importer only reads a part's first <score-instrument>. Both are ways MusicXML encodes an instrument change partway through a part.
- Lenguaje dominante
- Python
- Estrellas
- 2.6k
- Forks
- 459
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 39
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cuthbertLab/music21
-
Midi bank number supportAbiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
cuthbertLab/music21#2088 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cuthbertLab/music21#2084 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
cuthbertLab/music21#2055 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Slur bezier-x/y from start element gets overwritten by stop element's valuesQuizá libre de nuevo @bingliscodes la tomó hace 14 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cuthbertLab/music21#2019 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
cuthbertLab/music21#1714 ·
Los mantenedores suelen responder en 1 día
Todos los issues de cuthbertLab/music21
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pgvector/pgvector-python#169 ·
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from gitPosiblemente ocupada @MohabMohie la tomó hoy. Abiertoagentic
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
huggingface/smolagents#3045 ·
Los mantenedores suelen responder en 1 día