Skip to content

Commit c260338

Browse files
committed
Document instance variables in __init__() for NoteOn and NoteOff
1 parent bd72ad4 commit c260338

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

adafruit_midi/note_off.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ class NoteOff(MIDIMessage): # pylint: disable=duplicate-code
3737

3838
def __init__(self, note, velocity=0, *, channel=None):
3939
self.note = note_parser(note)
40-
"""key, either int (0-127) or string that will be turned off """
40+
"""Key, either int (0-127) or string that will be turned off """
4141
self.velocity = velocity
42+
"""Release velocity, int (0-127) """
4243
super().__init__(channel=channel)
4344
if not 0 <= self.note <= 127 or not 0 <= self.velocity <= 127:
4445
self._raise_valueerror_oor()

adafruit_midi/note_on.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ class NoteOn(MIDIMessage):
3737

3838
def __init__(self, note, velocity=127, *, channel=None):
3939
self.note = note_parser(note)
40+
"""Key, either int (0-127) or string that will be turned on """
4041
self.velocity = velocity
42+
"""Strike velocity, int (0-127); 0 is equivalent to Note Off """
4143
super().__init__(channel=channel)
4244
if not 0 <= self.note <= 127 or not 0 <= self.velocity <= 127:
4345
self._raise_valueerror_oor()

0 commit comments

Comments
 (0)