Skip to content

NameError: name 'chord' is not defined in 07_01_notation_compose.ipynb #30

@emres

Description

@emres

NameError: name 'chord' is not defined in 07_01_notation_compose.ipynb:

NameError                                 Traceback (most recent call last)
<ipython-input-5-fbeff2cc0330> in <module>
      4 for element in original_score.flat:
      5 
----> 6     if isinstance(element, chord.Chord):
      7         notes.append('.'.join(n.nameWithOctave for n in element.pitches))
      8         durations.append(element.duration.quarterLength)

NameError: name 'chord' is not defined

because chord is missing from the imports. There's a similar problem with note:

from music21 import converter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions