Skip to content

Commit

Permalink
Cleaned up instrument classes.
Browse files Browse the repository at this point in the history
Reimplemented instruments as frozen data classes.

REMOVED:

    * abjad.Instrument.markup
    * abjad.Instrument.name
    * abjad.Instrument.short_markup
    * abjad.Instrument.short_name

CHANGED:

    OLD: abjad.Instrument.allowable_clefs=("treble", "bass")
    NEW: abjad.Instrument.clefs==("treble", "bass")
  • Loading branch information
trevorbaca committed Jun 2, 2022
1 parent 648dd4a commit 238d146
Show file tree
Hide file tree
Showing 5 changed files with 503 additions and 3,139 deletions.
6 changes: 3 additions & 3 deletions abjad/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def annotation(
>>> string = 'default_instrument'
>>> abjad.get.annotation(staff[0], string)
Cello()
Cello(clefs=('bass', 'tenor', 'treble'), context='Staff', middle_c_sounding_pitch=NamedPitch("c'"), pitch_range=PitchRange(range_string='[C2, G5]'), tuning=Tuning(pitches=(NamedPitch('c,'), NamedPitch('g,'), NamedPitch('d'), NamedPitch('a'))))
>>> abjad.get.annotation(staff[1], string) is None
True
Expand All @@ -152,7 +152,7 @@ def annotation(
Returns default when no annotation is found:
>>> abjad.get.annotation(staff[3], string, abjad.Violin())
Violin()
Violin(clefs=('treble',), context='Staff', middle_c_sounding_pitch=NamedPitch("c'"), pitch_range=PitchRange(range_string='[G3, G7]'), tuning=Tuning(pitches=(NamedPitch('g'), NamedPitch("d'"), NamedPitch("a'"), NamedPitch("e''"))))
.. container:: example
Expand Down Expand Up @@ -199,7 +199,7 @@ def annotation_wrappers(argument):
}
>>> for wrapper in abjad.get.annotation_wrappers(staff[0]): wrapper
Wrapper(annotation='default_instrument', context=None, deactivate=False, direction=None, indicator=Cello(), synthetic_offset=None, tag=Tag(string=''))
Wrapper(annotation='default_instrument', context=None, deactivate=False, direction=None, indicator=Cello(clefs=('bass', 'tenor', 'treble'), context='Staff', middle_c_sounding_pitch=NamedPitch("c'"), pitch_range=PitchRange(range_string='[C2, G5]'), tuning=Tuning(pitches=(NamedPitch('c,'), NamedPitch('g,'), NamedPitch('d'), NamedPitch('a')))), synthetic_offset=None, tag=Tag(string=''))
Wrapper(annotation='default_clef', context=None, deactivate=False, direction=None, indicator=Clef(name='tenor', hide=False), synthetic_offset=None, tag=Tag(string=''))
"""
Expand Down
Loading

0 comments on commit 238d146

Please sign in to comment.