From fc02253f8975b0efa98927db7d8738e3bbaeba95 Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert Date: Wed, 3 Jan 2024 11:24:25 -1000 Subject: [PATCH] document NotRest a bit. --- music21/note.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/music21/note.py b/music21/note.py index 358116bb0..3df3dc047 100644 --- a/music21/note.py +++ b/music21/note.py @@ -996,6 +996,14 @@ class NotRest(GeneralNote): Basically, that's a :class:`Note` or :class:`~music21.chord.Chord` (or their subclasses such as :class:`~music21.harmony.ChordSymbol`), or :class:`Unpitched` object. + + NotRest elements are generally not created on their own. It is a class + that exists to store common functionality used by Note, Unpitched, and Chord objects. + + >>> nr = note.NotRest(storedInstrument=instrument.Ocarina()) + >>> nr.stemDirection = 'up' + + * Changed in v9: beams is keyword only. Added storedInstrument keyword. ''' # unspecified means that there may be a stem, but its orientation # has not been declared. @@ -1012,7 +1020,9 @@ class NotRest(GeneralNote): ) def __init__(self, + *, beams: beam.Beams|None = None, + storedInstrument: instrument.Instrument|None = None, **keywords): super().__init__(**keywords) self._notehead: str = 'normal' @@ -1024,7 +1034,7 @@ def __init__(self, self.beams = beams else: self.beams = beam.Beams() - self._storedInstrument: instrument.Instrument|None = None + self._storedInstrument: instrument.Instrument|None = storedInstrument self._chordAttached: chord.ChordBase|None = None # ==============================================================================================