NoteHead

class scoretools.NoteHead(written_pitch=None, client=None, is_cautionary=None, is_forced=None, is_parenthesized=None, tweak_pairs=())

A note-head.

>>> note_head = scoretools.NoteHead(13)
>>> note_head
NoteHead("cs''")

Note heads are immutable.

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_scoretools { graph [label=scoretools]; "abjad.tools.scoretools.DrumNoteHead.DrumNoteHead" [color=3, group=2, label=DrumNoteHead, shape=box]; "abjad.tools.scoretools.NoteHead.NoteHead" [color=black, fontcolor=white, group=2, label=<<B>NoteHead</B>>, shape=box, style="filled, rounded"]; "abjad.tools.scoretools.NoteHead.NoteHead" -> "abjad.tools.scoretools.DrumNoteHead.DrumNoteHead"; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.scoretools.NoteHead.NoteHead"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

client Client of note-head.
is_cautionary Gets and sets cautionary accidental flag.
is_forced Gets and sets forced accidental flag.
is_parenthesized Gets and sets forced accidental flag.
named_pitch Named pitch of note-head.
tweak LilyPond tweak reservoir of note-head.
written_pitch Gets and sets written pitch of note-head.
__copy__(*arguments) Copies note-head.
__eq__(argument) Is true when argument is a note-head with written pitch equal to that of this note-head.
__format__([format_specification]) Formats note-head.
__ge__(other[, NotImplemented]) Return a >= b.
__gt__(other[, NotImplemented]) Return a > b.
__hash__() Hashes note-head.
__le__(other[, NotImplemented]) Return a <= b.
__lt__(argument) Is true when argument is a note-head with written pitch greater than that of this note-head.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of note-head.
__str__() String representation of note-head.

Read-only properties

NoteHead.client

Client of note-head.

>>> note_head.client is None
True

Returns note, chord or none.

NoteHead.named_pitch

Named pitch of note-head.

>>> note_head = scoretools.NoteHead("cs''")
>>> note_head.named_pitch
NamedPitch("cs''")

Returns named pitch.

NoteHead.tweak

LilyPond tweak reservoir of note-head.

>>> note_head = scoretools.NoteHead("cs''")
>>> note_head.tweak
LilyPondNameManager()

Returns LilyPond tweak reservoir.

Read/write properties

NoteHead.is_cautionary

Gets and sets cautionary accidental flag.

Gets cautionary accidental flag:

>>> note_head = scoretools.NoteHead("cs''")
>>> note_head.is_cautionary is None
True

Sets cautionary accidental flag:

>>> note_head = scoretools.NoteHead("cs''")
>>> note_head.is_cautionary = True

Returns true or false.

NoteHead.is_forced

Gets and sets forced accidental flag.

Gets forced accidental flag:

>>> note_head = scoretools.NoteHead("cs''")
>>> note_head.is_forced is None
True

Sets forced accidental flag:

>>> note_head = scoretools.NoteHead("cs''")
>>> note_head.is_forced = True

Returns true or false.

NoteHead.is_parenthesized

Gets and sets forced accidental flag.

Gets forced accidental flag:

>>> note_head = scoretools.NoteHead("cs''")
>>> note_head.is_parenthesized is None
True

Sets forced accidental flag:

>>> note_head = scoretools.NoteHead("cs''")
>>> note_head.is_parenthesized = True

Returns true or false.

NoteHead.written_pitch

Gets and sets written pitch of note-head.

Gets written pitch of note-head:

>>> note_head = scoretools.NoteHead("cs''")
>>> note_head.written_pitch
NamedPitch("cs''")

Sets written pitch of note-head:

>>> note_head = scoretools.NoteHead("cs''")
>>> note_head.written_pitch = "d''"
>>> note_head.written_pitch
NamedPitch("d''")

Returns named pitch.

Special methods

NoteHead.__copy__(*arguments)

Copies note-head.

>>> import copy
>>> copy.copy(note_head)
NoteHead("cs''")

Returns new note-head.

NoteHead.__eq__(argument)

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

Returns true or false.

NoteHead.__format__(format_specification='')

Formats note-head.

Returns string.

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.

Required to be explicitly redefined on Python 3 if __eq__ changes.

Returns integer.

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. Otherwise false.

Returns true or false.

(AbjadObject).__ne__(argument)

Is true when Abjad object does not equal argument. Otherwise false.

Returns true or false.

NoteHead.__repr__()

Gets interpreter representation of note-head.

>>> note_head
NoteHead("cs''")

Returns string.

NoteHead.__str__()

String representation of note-head.

>>> str(note_head)
"cs''"

Returns string.