cuthbertLab/music21

note.step doesn't support assignment

Opened this issue · 0 comments

music21 version

9.8.7

Problem summary

Either make "step" assignable in note.Note objects or change the documentation to reflect this. If the latter, then change this line in music21's humdrum spine parser accordingly. Currently this line doesn't seem to do anything:
https://github.com/alexandermorgan/music21/blob/f457a2ba52ea3f978d805cd52fa101dfb0dd8577/music21/humdrum/spineParser.py#L2223C9-L2223C9

Steps to reproduce

import music21
from music21 import note

g = note.Note(step='g')
print(g.step)    # prints: <music21.note.Note C>

Expected vs. actual behavior

I expected this to work the same as it does for pitch.Pitch objects, where passing a step argument does change the step attribute of the object.
More information

If I understood correctly, note.Note inherits the step attribute from pitch.Pitch. Related to this bug, it's not clear to me where the pitch information of notes is assigned when parsing humdrum. In contrast, this is clear for the assignment of octave information. I am happy to contribute a PR for this if the preferred solution is made clear to me.