DrumNoteHead

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.core" { graph [label="abjad.core"]; node [color=1]; "abjad.core.DrumNoteHead.DrumNoteHead" [URL="../api/abjad/core/DrumNoteHead.html#abjad.core.DrumNoteHead.DrumNoteHead", color=black, fontcolor=white, label="Drum\nNote\nHead", target=_top]; "abjad.core.NoteHead.NoteHead" [URL="../api/abjad/core/NoteHead.html#abjad.core.NoteHead.NoteHead", label="Note\nHead", target=_top]; "abjad.core.NoteHead.NoteHead" -> "abjad.core.DrumNoteHead.DrumNoteHead"; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/core/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "abjad.system.AbjadObject.AbjadObject" -> "abjad.core.NoteHead.NoteHead"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.core.DrumNoteHead.DrumNoteHead(written_pitch='snare', client=None, is_cautionary=None, is_forced=None, is_parenthesized=None, tweaks=())

Drum note-head.

>>> note_head = abjad.DrumNoteHead('snare')
>>> note_head
DrumNoteHead('snare')

Special methods

(NoteHead).__copy__(*arguments)

Copies note-head.

>>> import copy
>>> note_head = abjad.NoteHead(13)
>>> copy.copy(note_head)
NoteHead("cs''")

REGRESSION. Note-heads work with new:

>>> note = abjad.Note("cs''")
>>> abjad.new(note.note_head)
NoteHead("cs''")
Return type:NoteHead
(NoteHead).__eq__(argument)

Is true when `argument is a note-head with written pitch equal to that of this note-head.

Return type:bool
(NoteHead).__format__(format_specification='')

Formats note-head.

Return type:str
(NoteHead).__ge__(other, NotImplemented=NotImplemented)

Return a >= b. Computed by @total_ordering from (not a < b).

(NoteHead).__gt__(other, NotImplemented=NotImplemented)

Return a > b. Computed by @total_ordering from (not a < b) and (a != b).

(NoteHead).__hash__()

Hashes note-head.

Redefined in tandem with __eq__.

Return type:int
(NoteHead).__le__(other, NotImplemented=NotImplemented)

Return a <= b. Computed by @total_ordering from (a < b) or (a == b).

(NoteHead).__lt__(argument)

Is true when argument is a note-head with written pitch greater than that of this note-head.

Return type:bool
(NoteHead).__repr__()

Gets interpreter representation of note-head.

>>> note_head = abjad.NoteHead(13)
>>> note_head
NoteHead("cs''")
Return type:str
(NoteHead).__str__()

Gets string representation of note-head.

>>> note_head = abjad.NoteHead(13)
>>> str(note_head)
"cs''"
Return type:str

Read/write properties

(NoteHead).alternative

Gets and sets note-head alternative.

>>> note = abjad.Note("c''4")
>>> alternative = abjad.new(note.note_head)
>>> alternative.is_forced = True
>>> note.note_head.alternative = (alternative, '-PARTS', '+PARTS')
>>> abjad.show(note) 
>>> abjad.f(note, strict=50)
c''4                                              %! +PARTS
%@% c''!4                                         %! -PARTS

Survives pitch reassignment:

>>> note.written_pitch = 'D5'
>>> abjad.show(note) 
>>> abjad.f(note, strict=50)
d''4                                              %! +PARTS
%@% d''!4                                         %! -PARTS

Clear with none:

>>> note.note_head.alternative = None
>>> abjad.show(note) 
>>> abjad.f(note, strict=50)
d''4
>>> chord = abjad.Chord("<c' d' bf''>4")
>>> alternative = abjad.new(chord.note_heads[0])
>>> alternative.is_forced = True
>>> chord.note_heads[0].alternative = (alternative, '-PARTS', '+PARTS')
>>> abjad.show(chord) 
>>> abjad.f(chord, strict=50)
<
    c'                                            %! +PARTS
%@% c'!                                           %! -PARTS
    d'
    bf''
>4

Suvives pitch reassignment:

>>> chord.note_heads[0].written_pitch = 'B3'
>>> abjad.show(chord) 
>>> abjad.f(chord, strict=50)
<
    b                                             %! +PARTS
%@% b!                                            %! -PARTS
    d'
    bf''
>4

Clear with none:

>>> chord.note_heads[0].alternative = None
>>> abjad.f(chord, strict=50)
<b d' bf''>4
Return type:Tuple[NoteHead, str, str]
(NoteHead).is_cautionary

Gets and sets cautionary accidental flag.

>>> note = abjad.Note("c''")
>>> note.note_head.is_cautionary = True
>>> abjad.show(note) 
>>> note = abjad.Note("cs''")
>>> note.note_head.is_cautionary = True
>>> abjad.show(note) 
Return type:bool
(NoteHead).is_forced

Gets and sets forced accidental flag.

>>> note = abjad.Note("c''")
>>> note.note_head.is_forced = True
>>> abjad.show(note) 
>>> note = abjad.Note("cs''")
>>> note.note_head.is_forced = True
>>> abjad.show(note) 
Return type:bool
(NoteHead).is_parenthesized

Gets and sets forced accidental flag.

>>> note = abjad.Note("c''")
>>> note.note_head.is_parenthesized = True
>>> abjad.show(note) 
>>> note = abjad.Note("cs''")
>>> note.note_head.is_parenthesized = True
>>> abjad.show(note) 
Return type:bool
(NoteHead).written_pitch

Gets and sets written pitch of note-head.

>>> note_head = abjad.NoteHead("cs''")
>>> note_head.written_pitch
NamedPitch("cs''")
>>> note_head = abjad.NoteHead("cs''")
>>> note_head.written_pitch = "d''"
>>> note_head.written_pitch
NamedPitch("d''")
Return type:NamedPitch

Read-only properties

(NoteHead).client

Gets client of note-head.

>>> note_head = abjad.NoteHead(13)
>>> note_head.client is None
True

Returns note, chord or none.

(NoteHead).named_pitch

Gets named pitch.

>>> note_head = abjad.NoteHead("cs''")
>>> note_head.named_pitch
NamedPitch("cs''")
Return type:NamedPitch
(NoteHead).tweaks

Gets tweaks.

>>> note_head = abjad.NoteHead("cs''")
>>> note_head.tweaks
LilyPondTweakManager()
>>> abjad.tweak(note_head).color = 'red'
>>> abjad.f(note_head)
\tweak color #red
cs''
Return type:LilyPondTweakManager