Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Missing humdrumPosition in thisSpine.stream.flatten() with root cause analysis

Abierto
#1,700 1 comentario 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
data

Línea de trabajo

Start with the Humdrum (**kern) parser's DynamSpine.parse() around line 1445, where a Dynamic is created for the piano marking in the pickup measure. Then check the del el.humdrumPosition at about line 1811 and the lookup prioritiesToSearch[dynamic.humdrumPosition] at about line 1947. Done means a score parsed from sonata06-1.krn without an AttributeError, with the pickup dynamic kept in the stream. The reproduction needs the external kern file, so get a local copy first.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

music21 version

9.1.0

Problem summary

Loaded a krn format into music21 and received the following error message:

AttributeError: 'Dynamic' object has no attribute 'humdrumPosition'

Steps to reproduce

from music21 import converter
score = converter.parse('http://kern.ccarh.org/data?l=beethoven/sonatas&file=sonata06-1.krn')

Expected vs. actual behavior

Expecting the Sonata to render but get error message instead.

Root Cause Analysis

After running the debugger, I noticed that when the parse() method from the DynamSpine class is run in line 1445, and when eventC = 'p', then a Dynamic object is created <music21.dynamics.Dynamic p>. This object has a humdrumPosition attribute. But this attribute is removed from the object in line 1811 (del el.humdrumPosition) which is why when trying to access this attribute in line 1947 (prioritiesToSearch[dynamic.humdrumPosition] = dynamic), we receive the error message.

In this particular sonata, I noticed that the dynamic object is the piano marking in the pickup measure. Curiously, if we remove this marking from the .krn file (line 21), then everything works as expected.

To summarize, it is likely that music21 has difficulty parsing dynamic markings found in pickup measures

Miscellaneous Information
Apple M1 Pro
macOS Sonoma 14.3.1

Lenguaje dominante
Python
Estrellas
2.6k
Forks
459
Merge medio
1 d 7 h
PR fusionados (30 d)
40

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cuthbertLab/music21

Todos los issues de cuthbertLab/music21

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.