Skip to content

Commit 4fdaab1

Browse files
authored
Expose velocity attribute
1 parent 0c30d66 commit 4fdaab1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_midi/note_off.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ class NoteOff(MIDIMessage): # pylint: disable=duplicate-code
3838
def __init__(self, note, velocity=0, *, channel=None):
3939
self.note = note_parser(note)
4040
"""key, either int (0-127) or string that will be turned off """
41-
self._velocity = velocity
41+
self.velocity = velocity
4242
super().__init__(channel=channel)
43-
if not 0 <= self.note <= 127 or not 0 <= self._velocity <= 127:
43+
if not 0 <= self.note <= 127 or not 0 <= self.velocity <= 127:
4444
self._raise_valueerror_oor()
4545

4646
def __bytes__(self):
4747
return bytes(
4848
[
4949
self._STATUS | (self.channel & self.CHANNELMASK),
5050
self.note,
51-
self._velocity,
51+
self.velocity,
5252
]
5353
)
5454

0 commit comments

Comments
 (0)