Skip to content

Made note public variable #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 30, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions adafruit_midi/note_off.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
""" self.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,
]
)
Expand Down