diff --git a/adafruit_midi/note_off.py b/adafruit_midi/note_off.py index 83c34f0..202c705 100644 --- a/adafruit_midi/note_off.py +++ b/adafruit_midi/note_off.py @@ -36,17 +36,18 @@ class NoteOff(MIDIMessage): # pylint: disable=duplicate-code LENGTH = 3 def __init__(self, note, velocity=0, *, channel=None): - self._note = note_parser(note) + self.note = note_parser(note) + """key, either int (0-127) or string that will be turned off """ self._velocity = velocity super().__init__(channel=channel) - if not 0 <= self._note <= 127 or not 0 <= self._velocity <= 127: + if not 0 <= self.note <= 127 or not 0 <= self._velocity <= 127: self._raise_valueerror_oor() def __bytes__(self): return bytes( [ self._STATUS | (self.channel & self.CHANNELMASK), - self._note, + self.note, self._velocity, ] )