From e9b2091f88c026c77ca034df2d36b94ccc8c89ce Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 24 Sep 2021 13:01:57 -0400 Subject: [PATCH 1/3] Made note public variable --- adafruit_midi/note_off.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adafruit_midi/note_off.py b/adafruit_midi/note_off.py index 83c34f0..d9a7fc8 100644 --- a/adafruit_midi/note_off.py +++ b/adafruit_midi/note_off.py @@ -36,17 +36,17 @@ 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._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, ] ) From f1ceaa58ce2885e425865458ad0fcc7116eda44c Mon Sep 17 00:00:00 2001 From: dherrada Date: Tue, 28 Sep 2021 12:45:44 -0400 Subject: [PATCH 2/3] added comment --- adafruit_midi/note_off.py | 1 + 1 file changed, 1 insertion(+) diff --git a/adafruit_midi/note_off.py b/adafruit_midi/note_off.py index d9a7fc8..d7cd066 100644 --- a/adafruit_midi/note_off.py +++ b/adafruit_midi/note_off.py @@ -37,6 +37,7 @@ class NoteOff(MIDIMessage): # pylint: disable=duplicate-code def __init__(self, note, velocity=0, *, channel=None): 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: From 61d8728db9e6b54f584d11d5f1fca1f8ee955339 Mon Sep 17 00:00:00 2001 From: Dylan Herrada <33632497+dherrada@users.noreply.github.com> Date: Tue, 28 Sep 2021 13:14:01 -0400 Subject: [PATCH 3/3] Update adafruit_midi/note_off.py Co-authored-by: Scott Shawcroft --- adafruit_midi/note_off.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_midi/note_off.py b/adafruit_midi/note_off.py index d7cd066..202c705 100644 --- a/adafruit_midi/note_off.py +++ b/adafruit_midi/note_off.py @@ -37,7 +37,7 @@ class NoteOff(MIDIMessage): # pylint: disable=duplicate-code def __init__(self, note, velocity=0, *, channel=None): self.note = note_parser(note) - """ self.note: key, either int (0-127) or string that will be turned off """ + """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: