abjad.score
Copies overrides, settings and wrappers from |
|
After grace container. |
|
Grace container. |
|
|
Chord. |
|
Cluster. |
|
Component. |
|
Container. |
|
LilyPond context. |
|
Drum note-head. |
Independent after grace container. |
|
|
Leaf. |
|
Multimeasure rest. |
|
Note. |
|
Note-head. |
|
Note-head list. |
|
Rest. |
|
Score. |
|
LilyPond skip. |
|
Staff. |
|
Staff group. |
|
Tremolo container. |
|
Tuplet. |
|
Voice. |
- abjad.score.copy_overrides_settings_and_wrappers(donor: Component, recipient: Component) None [source]
Copies overrides, settings and wrappers from
donor
torecipient
.
- class abjad.score.AfterGraceContainer(components=None, *, fraction: tuple[int, int] | None = None, language: str = 'english', tag: Tag | None = None)[source]
After grace container.
After grace notes are played in the last moments of duration of the note they follow.
Fill after grace containers with notes, rests or chords.
Attach after grace containers to notes, rests or chords.
LilyPond positions after grace notes at a point 3/4 of the way after the note they follow. The resulting spacing is usually too loose. Customize
fraction
as shown here:>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> notes = [abjad.Note("c'16"), abjad.Note("d'16")] >>> after_grace_container = abjad.AfterGraceContainer(notes, fraction=(15, 16)) >>> abjad.attach(after_grace_container, voice[1]) >>> abjad.show(voice)
REGRESSION. After grace containers format correctly with main note articulations and markup:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.AfterGraceContainer("c'16 d'16", fraction=(15, 16)) >>> abjad.attach(container, voice[1]) >>> leaves = abjad.select.leaves(voice, grace=None) >>> markup = abjad.Markup(r"\markup Allegro") >>> abjad.attach(markup, leaves[1], direction=abjad.UP) >>> abjad.attach(abjad.Articulation("."), leaves[1]) >>> abjad.show(voice)
REGRESSION #1074. After grace containers format correctly with chords and overrides. It is important here that the
\afterGrace
command appear lexically after the\override
command:>>> voice = abjad.Voice("c'4 <d' f'>4 e'4 f'4") >>> container = abjad.AfterGraceContainer("c'16 d'16", fraction=(15, 16)) >>> abjad.attach(container, voice[1]) >>> abjad.override(voice[1]).NoteHead.color = "#red" >>> abjad.show(voice)
fraction
()Gets LilyPond afterGraceFraction.
set_fraction
(fraction)Sets LilyPond afterGraceFraction.
- class abjad.score.BeforeGraceContainer(components=None, *, command: str = '\\grace', language: str = 'english', tag: Tag | None = None)[source]
Grace container.
LilyPond provides four types of left-positioned grace music: acciaccaturas, appoggiaturas, grace notes and slashed grace notes; see
abjad.BeforeGraceContainer.command
to choose between these. LilyPond’s left-positioned grace music contrasts with “right-positioned” after-grace music; seeabjad.AfterGraceContainer
.Note that neither LilyPond nor Abjad attempts to model the ways that different categories of grace music have been performed historically. Typographic differences in slurring and slashing are provided. But distinctions between (for example) on-the-beat versus before-the-beat performance are left implicit.
Grace container models LilyPond’s different types of “left-positioned” grace music:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16 ds'") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
Fill grace containers with notes, rests or chords:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("<cs' ds'>16 e'") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
Detach grace containers like this:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("<cs' ds'>16 e'") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
>>> abjad.detach(abjad.BeforeGraceContainer, voice[1]) (BeforeGraceContainer("<cs' ds'>16 e'16"),)
>>> abjad.detach(abjad.BeforeGraceContainer, voice[1]) ()
>>> abjad.show(voice)
Move grace containers like this:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("<cs' ds'>16 e'") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
>>> result = abjad.detach(abjad.BeforeGraceContainer, voice[1]) >>> container = result[0] >>> abjad.attach(container, voice[3]) >>> abjad.show(voice)
command
()Gets command.
- command() str [source]
Gets command. Chooses between LilyPond’s four types of left-positioned grace music.
(Vanilla) grace notes. LilyPond formats single grace notes with neither a slash nor a slur:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
LilyPond likewise formats runs of grace notes with neither a slash nor a slur:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16 ds'") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
Acciaccaturas. LilyPond formats single acciaccaturas with both a slash and a slur:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16", command=r"\acciaccatura") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
But LilyPond fails to slash runs of acciaccaturas. This behavior is a longstanding LilyPond bug:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16 ds'", command=r"\acciaccatura") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
Note
LilyPond fails to slash runs of acciaccaturas.
Appoggiaturas. LilyPond formats single appoggiaturas with only a slur; no slash is included:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16", command=r"\appoggiatura") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
LilyPond likewise formats runs of appoggiaturas with only a slur:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16 ds'", command=r"\appoggiatura") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
Slashed grace notes. LilyPond formats single slashed grace notes with only a slash; no slur is included:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16", command=r"\slashedGrace") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
But LilyPond fails to slash runs of “slashed” grace notes. This is a longstanding LilyPond bug:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16 ds'", command=r"\slashedGrace") >>> abjad.attach(container, voice[1]) >>> abjad.show(voice)
Note
LilyPond fails to slash runs of “slashed” grace notes.
LilyPond
\acciaccatura
,\appoggiatura
are syntactic sugar.Grace notes with slur may be used instead of appoggiatura:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16") >>> abjad.attach(container, voice[1]) >>> leaves = abjad.select.leaves(voice)[1:3] >>> abjad.slur(leaves) >>> abjad.show(voice)
Slashed grace notes with slur may be used instead of acciaccatura:
>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> container = abjad.BeforeGraceContainer("cs'16", command=r"\slashedGrace") >>> abjad.attach(container, voice[1]) >>> leaves = abjad.select.leaves(voice)[1:3] >>> abjad.slur(leaves) >>> abjad.show(voice)
- class abjad.score.Chord(string: str, language: str = 'english', multiplier: tuple[int, int] | None = None, tag: Tag | None = None)[source]
Chord.
>>> chord = abjad.Chord("<e' cs'' f''>4") >>> chord Chord("<e' cs'' f''>4")
>>> abjad.show(chord)
Gets chord note-heads.
set_note_heads
(note_heads)Sets note-heads in chord.
set_written_duration
(duration)Sets written duration of chord.
set_written_pitches
(pitches)Sets written pitches of chord.
Gets written duration of chord.
Written pitches in chord.
- note_heads() NoteHeadList [source]
Gets chord note-heads.
>>> chord = abjad.Chord("<g' c'' e''>4") >>> chord.note_heads() [NoteHead("g'"), NoteHead("c''"), NoteHead("e''")]
- set_note_heads(note_heads: Sequence[NoteHead]) None [source]
Sets note-heads in chord.
>>> chord = abjad.Chord("<c' d' b'>4") >>> pitches = [abjad.NamedPitch(_) for _ in "e' cs' f''".split()] >>> note_heads = [abjad.NoteHead(_) for _ in pitches] >>> chord.set_note_heads(note_heads) >>> chord Chord("<cs' e' f''>4")
- overridden set_written_duration(duration: Duration) None [source]
Sets written duration of chord.
>>> chord = abjad.Chord("<e' cs'' f''>4") >>> chord.written_duration() Duration(1, 4)
>>> chord.set_written_duration(abjad.Duration(1, 16)) >>> chord.written_duration() Duration(1, 16)
- set_written_pitches(pitches: Sequence[NamedPitch | str]) None [source]
Sets written pitches of chord.
>>> chord = abjad.Chord("<c' d' b'>4") >>> pitches = [abjad.NamedPitch(_) for _ in "e' cs' f''".split()] >>> chord.set_written_pitches(pitches) >>> chord Chord("<cs' e' f''>4")
- overridden written_duration() Duration [source]
Gets written duration of chord.
>>> abjad.Chord("<e' cs'' f''>4").written_duration() Duration(1, 4)
- written_pitches() tuple[NamedPitch, ...] [source]
Written pitches in chord.
Get written pitches:
>>> chord = abjad.Chord("<g' c'' e''>4") >>> abjad.show(chord)
>>> chord.written_pitches() (NamedPitch("g'"), NamedPitch("c''"), NamedPitch("e''"))
Set written pitches with pitch names:
>>> chord = abjad.Chord("<e' g' c''>4") >>> abjad.show(chord)
>>> pitches = [abjad.NamedPitch(_) for _ in "f' b' d''".split()] >>> chord.set_written_pitches(pitches) >>> abjad.show(chord)
>>> chord.written_pitches() (NamedPitch("f'"), NamedPitch("b'"), NamedPitch("d''"))
- class abjad.score.Cluster(components=None, *, identifier: str | None = None, language: str = 'english', name: str | None = None, simultaneous: bool = False, tag: Tag | None = None)[source]
Cluster.
>>> cluster = abjad.Cluster("c'8 <d' g'>8 b'8") >>> abjad.show(cluster)
>>> cluster Cluster("c'8 <d' g'>8 b'8")
- class abjad.score.Component(*, tag: Tag | None = None)[source]
Component.
set_tag
(argument)Sets component tag.
tag
()Gets component tag.
- class abjad.score.Container(components=None, *, identifier: str | None = None, language: str = 'english', name: str | None = None, simultaneous: bool = False, tag: Tag | None = None)[source]
Container.
Intializes from string:
>>> container = abjad.Container("c'4 e'4 d'4 e'8 f'8") >>> abjad.show(container)
Intializes from components:
>>> notes = [ ... abjad.Note("c'4"), ... abjad.Note("e'4"), ... abjad.Note("d'4"), ... abjad.Note("e'8"), ... abjad.Note("f'8"), ... ] >>> container = abjad.Container(notes) >>> abjad.show(container)
Containers are iterables:
>>> import collections >>> container = abjad.Container("c'4 e'4 d'4 e'8 f'8") >>> isinstance(container, collections.abc.Iterable) True
Containers are not sequences because containers do not implement reverse:
>>> container = abjad.Container("c'4 e'4 d'4 e'8 f'8") >>> isinstance(container, collections.abc.Sequence) False
Formatting positions contributions strictly one-per-line:
>>> staff = abjad.Staff("c'4 d' e' f'") >>> abjad.attach(abjad.Articulation("^"), staff[0]) >>> markup = abjad.Markup(r"\markup Allegro") >>> abjad.attach(markup, staff[0], direction=abjad.UP) >>> abjad.attach(abjad.StemTremolo(), staff[0]) >>> abjad.show(staff)
>>> string = abjad.lilypond(staff) >>> print(string) \new Staff { c'4 :16 - \marcato ^ \markup Allegro d'4 e'4 f'4 }
append
(component, *[, language])Appends
component
to container.Gets components in container.
extend
(argument, *[, language])Extends container with
argument
.Gets bracket comment.
index
(component)Returns index of
component
in container.insert
(i, component, *[, language])Inserts
component
at indexi
in container.name
()Gets name of container.
pop
([i])Pops component from container at index
i
.remove
(component)Removes
component
from container.set_identifier
(argument)Sets bracket comment.
set_name
(argument)Sets name of container.
set_simultaneous
(argument)Sets container
simultaneous
flag.Gets container
simultaneous
flag.- append(component: Component, *, language: str = 'english') None [source]
Appends
component
to container.Appends note to container:
>>> container = abjad.Container("c'4 ( d'4 f'4 )") >>> abjad.show(container)
>>> container.append(abjad.Note("e'4")) >>> abjad.show(container)
- extend(argument, *, language: str = 'english') None [source]
Extends container with
argument
.Extends container with three notes:
>>> container = abjad.Container("c'4 ( d'4 f'4 )") >>> abjad.show(container)
>>> notes = [abjad.Note("e'32"), abjad.Note("d'32"), abjad.Note("e'16")] >>> container.extend(notes) >>> abjad.show(container)
- identifier() str | None [source]
Gets bracket comment.
>>> container = abjad.Container( ... "c'4 d'4 e'4 f'4", ... identifier="%*% AB", ... ) >>> abjad.show(container)
>>> string = abjad.lilypond(container) >>> print(string) { %*% AB c'4 d'4 e'4 f'4 } %*% AB
- index(component) int [source]
Returns index of
component
in container.Gets index of last element in container:
>>> container = abjad.Container("c'4 d'4 f'4 e'4") >>> abjad.show(container)
>>> note = container[-1] >>> note Note("e'4")
>>> container.index(note) 3
- insert(i: int, component: str | Component, *, language: str = 'english') None [source]
Inserts
component
at indexi
in container.Inserts note:
>>> container = abjad.Container([]) >>> container.extend("fs16 cs' e' a'") >>> container.extend("cs''16 e'' cs'' a'") >>> container.extend("fs'16 e' cs' fs") >>> abjad.show(container)
>>> container.insert(-4, abjad.Note("e'4")) >>> abjad.show(container)
- name() str | None [source]
Gets name of container.
Gets container name:
>>> container = abjad.Container("c'4 d'4 e'4 f'4") >>> abjad.show(container)
>>> container.name() is None True
- pop(i: int = -1) Component [source]
Pops component from container at index
i
.Pops last element from container:
>>> container = abjad.Container("c'4 ( d'4 f'4 ) e'4") >>> abjad.show(container)
>>> container.pop() Note("e'4")
>>> abjad.show(container)
- remove(component: Component) None [source]
Removes
component
from container.Removes note from container:
>>> container = abjad.Container("c'4 d'4 f'4 e'4") >>> abjad.show(container)
>>> note = container[2] >>> note Note("f'4")
>>> container.remove(note) >>> abjad.show(container)
- set_name(argument)[source]
Sets name of container.
>>> container = abjad.Container("c'4 d'4 e'4 f'4", name="Special") >>> abjad.show(container)
>>> container.name() 'Special'
Container name does not appear in LilyPond output:
>>> string = abjad.lilypond(container) >>> print(string) { c'4 d'4 e'4 f'4 }
- simultaneous() bool | None [source]
Gets container
simultaneous
flag.Gets simultaneity status of container:
>>> container = abjad.Container() >>> container.append(abjad.Voice("c'8 d'8 e'8")) >>> container.append(abjad.Voice("g4.")) >>> abjad.show(container)
>>> container.simultaneous() False
Sets simultaneity status of container:
>>> container = abjad.Container() >>> container.append(abjad.Voice("c'8 d'8 e'8")) >>> container.append(abjad.Voice("g4.")) >>> abjad.show(container)
>>> container.set_simultaneous(True) >>> abjad.show(container)
- class abjad.score.Context(components=None, *, language: str = 'english', lilypond_type: str = 'Context', name: str | None = None, simultaneous: bool = False, tag: Tag | None = None)[source]
LilyPond context.
>>> context = abjad.Context(lilypond_type="GlobalContext", name="Meter_Voice") >>> context Context(lilypond_type='GlobalContext', name='Meter_Voice')
Unordered set of LilyPond engravers to include in context definition.
Gets LilyPond type of context.
Unordered set of LilyPond engravers to remove from context.
set_lilypond_type
(argument)Sets LilyPond type of context.
- consists_commands()[source]
Unordered set of LilyPond engravers to include in context definition.
Manage with add, update, other standard set commands:
>>> staff = abjad.Staff([]) >>> staff.consists_commands().append("Horizontal_bracket_engraver") >>> string = abjad.lilypond(staff) >>> print(string) \new Staff \with { \consists Horizontal_bracket_engraver } { }
- lilypond_type() str [source]
Gets LilyPond type of context.
>>> context = abjad.Context( ... lilypond_type="ViolinStaff", ... name="MyViolinStaff", ... ) >>> context.lilypond_type() 'ViolinStaff'
- remove_commands()[source]
Unordered set of LilyPond engravers to remove from context.
Manage with add, update, other standard set commands:
>>> staff = abjad.Staff([]) >>> staff.remove_commands().append("Time_signature_engraver") >>> string = abjad.lilypond(staff) >>> print(string) \new Staff \with { \remove Time_signature_engraver } { }
- class abjad.score.DrumNoteHead(written_pitch: str = 'snare', *, is_cautionary: bool = False, is_forced: bool = False, is_parenthesized: bool = False, tweaks: Tweak | None = None)[source]
Drum note-head.
>>> note_head = abjad.DrumNoteHead("snare") >>> note_head DrumNoteHead('snare')
- class abjad.score.IndependentAfterGraceContainer(components=None, *, fraction: tuple[int, int] | None = None, language: str = 'english', tag: Tag | None = None)[source]
Independent after grace container.
LilyPond positions after grace notes at a point 3/4 of the way after the note they follow. The resulting spacing is usually too loose. Customize
fraction
as shown:>>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> notes = [abjad.Note("c'16"), abjad.Note("d'16")] >>> container = abjad.IndependentAfterGraceContainer(notes, fraction=(15, 16)) >>> voice.insert(2, container) >>> abjad.show(voice)
fraction
()Gets LilyPond afterGraceFraction.
set_fraction
(fraction)Sets LilyPond afterGraceFraction.
- class abjad.score.Leaf(written_duration: Duration, *, multiplier=None, tag: Tag | None = None)[source]
Leaf.
Gets leaf multiplier.
set_multiplier
(pair)Sets leaf multiplier.
set_written_duration
(duration)Sets leaf written duration.
Gets leaf written duration.
- class abjad.score.MultimeasureRest(string: str, *, language: str = 'english', multiplier: tuple[int, int] | None = None, tag: Tag | None = None)[source]
Multimeasure rest.
>>> rest = abjad.MultimeasureRest("R1") >>> rest MultimeasureRest('R1')
>>> abjad.show(rest)
- class abjad.score.Note(string: str, *, language: str = 'english', multiplier: tuple[int, int] | None = None, tag: Tag | None = None)[source]
Note.
>>> note = abjad.Note("c'4") >>> note Note("c'4")
>>> abjad.show(note)
Gets note note-head.
set_note_head
(note_head)Sets note-head of note.
set_written_duration
(duration)Sets written duration of note.
set_written_pitch
(pitch)Sets written pitch of note.
Gets written duration of note.
Gets written pitch of note.
- note_head() NoteHead [source]
Gets note note-head.
>>> note = abjad.Note("c'4") >>> note.note_head() NoteHead("c'")
- set_note_head(note_head: NoteHead) None [source]
Sets note-head of note.
>>> note = abjad.Note("c''4") >>> note.note_head() NoteHead("c''")
>>> pitch = abjad.NamedPitch("d''") >>> note_head = abjad.NoteHead(pitch) >>> note.set_note_head(note_head) >>> note.note_head() NoteHead("d''")
- overridden set_written_duration(duration: Duration) None [source]
Sets written duration of note.
>>> note = abjad.Note("c'4") >>> note.written_duration() Duration(1, 4)
>>> duration = abjad.Duration(1, 16) >>> note.set_written_duration(duration) >>> note.written_duration() Duration(1, 16)
- set_written_pitch(pitch: NamedPitch | str) None [source]
Sets written pitch of note.
>>> note = abjad.Note("c''8") >>> pitch = abjad.NamedPitch("D5") >>> note.set_written_pitch(pitch) >>> note Note("d''8")
- overridden written_duration() Duration [source]
Gets written duration of note.
>>> abjad.Note("c'4").written_duration() Duration(1, 4)
- written_pitch() NamedPitch | str [source]
Gets written pitch of note.
>>> abjad.Note("c'4").written_pitch() NamedPitch("c'")
- class abjad.score.NoteHead(written_pitch=NamedPitch("c'"), *, is_cautionary=False, is_forced=False, is_parenthesized=False, tweaks=())[source]
Note-head.
>>> note = abjad.Note("cs''") >>> abjad.show(note)
>>> note.note_head() NoteHead("cs''")
>>> pitch = abjad.NamedPitch("cs''") >>> note_head = abjad.NoteHead(pitch) >>> abjad.tweak(note_head, r"\tweak color #red") >>> note_head.tweaks (Tweak(string='\\tweak color #red', i=None, tag=None),)
>>> string = abjad.lilypond(note_head) >>> print(string) \tweak color #red cs''
>>> chord = abjad.Chord("<c' d' bf'>4")
>>> abjad.tweak(chord.note_heads()[0], r"\tweak color #red") >>> abjad.tweak(chord.note_heads()[0], r"\tweak thickness 2") >>> abjad.tweak(chord.note_heads()[1], r"\tweak color #red") >>> abjad.tweak(chord.note_heads()[1], r"\tweak thickness 2") >>> abjad.tweak(chord.note_heads()[2], r"\tweak color #blue") >>> abjad.show(chord)
Gets note-head alternative.
Gets cautionary accidental flag.
Gets forced accidental flag.
Gets parenthesized accidental flag.
set_alternative
(argument)Sets note-head alternative.
set_is_cautionary
(argument)Sets cautionary accidental flag.
set_is_forced
(argument)Sets forced accidental flag.
set_is_parenthesized
(argument)Sets parenthesized accidental flag.
set_written_pitch
(argument)Sets written pitch of note-head.
Gets and sets written pitch of note-head.
- alternative() tuple[NoteHead, Tag, Tag] [source]
Gets note-head alternative.
>>> import copy
>>> note = abjad.Note("c''4") >>> alternative = copy.copy(note.note_head()) >>> alternative.set_is_forced(True) >>> triple = (alternative, abjad.Tag("-PARTS"), abjad.Tag("+PARTS")) >>> note.note_head().set_alternative(triple) >>> abjad.show(note)
>>> string = abjad.lilypond(note, tags=True) >>> print(string) %! +PARTS c''4 %! -PARTS %@% c''!4
Survives pitch reassignment:
>>> pitch = abjad.NamedPitch("D5") >>> note.set_written_pitch(pitch) >>> abjad.show(note)
>>> string = abjad.lilypond(note, tags=True) >>> print(string) %! +PARTS d''4 %! -PARTS %@% d''!4
Clear with none:
>>> note.note_head().set_alternative(None) >>> abjad.show(note)
>>> string = abjad.lilypond(note, tags=True) >>> print(string) d''4
>>> chord = abjad.Chord("<c' d' bf''>4") >>> alternative = copy.copy(chord.note_heads()[0]) >>> alternative.set_is_forced(True) >>> triple = (alternative, abjad.Tag("-PARTS"), abjad.Tag("+PARTS")) >>> chord.note_heads()[0].set_alternative(triple) >>> abjad.show(chord)
>>> string = abjad.lilypond(chord, tags=True) >>> print(string) < %! +PARTS c' %! -PARTS %@% c'! d' bf'' >4
Suvives pitch reassignment:
>>> chord.note_heads()[0].set_written_pitch(abjad.NamedPitch("B3")) >>> abjad.show(chord)
>>> string = abjad.lilypond(chord, tags=True) >>> print(string) < %! +PARTS b %! -PARTS %@% b! d' bf'' >4
Clear with none:
>>> chord.note_heads()[0].set_alternative(None) >>> string = abjad.lilypond(chord, tags=True) >>> print(string) <b d' bf''>4
- is_cautionary() bool [source]
Gets cautionary accidental flag.
>>> note = abjad.Note("c''") >>> note.note_head().set_is_cautionary(True) >>> abjad.show(note)
>>> note = abjad.Note("cs''") >>> note.note_head().set_is_cautionary(True) >>> abjad.show(note)
- is_forced() bool [source]
Gets forced accidental flag.
>>> note = abjad.Note("c''") >>> note.note_head().set_is_forced(True) >>> abjad.show(note)
>>> note = abjad.Note("cs''") >>> note.note_head().set_is_forced(True) >>> abjad.show(note)
- is_parenthesized() bool [source]
Gets parenthesized accidental flag.
>>> note = abjad.Note("c''") >>> note.note_head().set_is_parenthesized(True) >>> abjad.show(note)
>>> note = abjad.Note("cs''") >>> note.note_head().set_is_parenthesized(True) >>> abjad.show(note)
- set_written_pitch(argument: NamedPitch | str) None [source]
Sets written pitch of note-head.
>>> note_head = abjad.NoteHead(abjad.NamedPitch("cs''")) >>> note_head.set_written_pitch(abjad.NamedPitch("d''")) >>> note_head.written_pitch() NamedPitch("d''")
- written_pitch() NamedPitch | str [source]
Gets and sets written pitch of note-head.
>>> note_head = abjad.NoteHead(abjad.NamedPitch("cs''")) >>> note_head.written_pitch() NamedPitch("cs''")
- class abjad.score.NoteHeadList(argument=())[source]
Note-head list.
>>> pitches = [abjad.NamedPitch(_) for _ in [11, 10, 9]] >>> note_heads = [abjad.NoteHead(_) for _ in pitches] >>> for _ in abjad.NoteHeadList(note_heads): ... _ ... NoteHead("a'") NoteHead("bf'") NoteHead("b'")
append
(item)Coerces
item
and appends note-head.extend
(items)Extends note-heads.
get
(pitch)Gets note-head by
pitch
.pop
([i])Pops note-head
i
.remove
(item)Removes
item
.- overridden extend(items) None [source]
Extends note-heads.
>>> chord = abjad.Chord("<ef'>4") >>> abjad.show(chord)
>>> note_heads = [] >>> note_head = abjad.NoteHead(abjad.NamedPitch("cs''")) >>> abjad.tweak(note_head, r"\tweak color #blue") >>> note_heads.append(note_head) >>> note_head = abjad.NoteHead(abjad.NamedPitch("f''")) >>> abjad.tweak(note_head, r"\tweak color #green") >>> note_heads.append(note_head) >>> chord.note_heads().extend(note_heads) >>> abjad.show(chord)
- get(pitch) NoteHead [source]
Gets note-head by
pitch
.Raises missing note-head error when chord contains no note-head with
pitch
.Raises extra note-head error when chord contains more than one note-head with
pitch
.Gets note-head by pitch name:
>>> chord = abjad.Chord("<e' cs'' f''>4") >>> abjad.show(chord)
>>> note_head = chord.note_heads().get("e'") >>> abjad.tweak(note_head, r"\tweak color #red") >>> abjad.show(chord)
Gets note-head by pitch number:
>>> chord = abjad.Chord("<e' cs'' f''>4") >>> abjad.show(chord)
>>> note_head = chord.note_heads().get(4) >>> abjad.tweak(note_head, r"\tweak color #red") >>> abjad.show(chord)
- class abjad.score.Rest(string: str, *, language: str = 'english', multiplier: tuple[int, int] | None = None, tag: Tag | None = None)[source]
Rest.
>>> rest = abjad.Rest("r4") >>> rest Rest('r4')
>>> abjad.show(rest)
- class abjad.score.Score(components=None, *, language: str = 'english', lilypond_type: str = 'Score', name: str | None = None, simultaneous: bool = True, tag: Tag | None = None)[source]
Score.
>>> staff_1 = abjad.Staff("c'8 d'8 e'8 f'8") >>> staff_2 = abjad.Staff("c'8 d'8 e'8 f'8") >>> score = abjad.Score([staff_1, staff_2]) >>> abjad.show(score)
- class abjad.score.Skip(string: str, language: str = 'english', multiplier: tuple[int, int] | None = None, tag: Tag | None = None)[source]
LilyPond skip.
>>> skip = abjad.Skip("s1") >>> skip Skip('s1')
- class abjad.score.Staff(components=None, *, language: str = 'english', lilypond_type: str = 'Staff', name: str | None = None, simultaneous: bool = False, tag: Tag | None = None)[source]
Staff.
>>> staff = abjad.Staff("c'8 d'8 e'8 f'8") >>> abjad.show(staff)
- class abjad.score.StaffGroup(components=None, *, language: str = 'english', lilypond_type: str = 'StaffGroup', name: str | None = None, simultaneous: bool = True, tag: Tag | None = None)[source]
Staff group.
>>> staff_1 = abjad.Staff("c'4 d'4 e'4 f'4 g'1") >>> staff_2 = abjad.Staff("g2 f2 e1") >>> staff_group = abjad.StaffGroup([staff_1, staff_2]) >>> abjad.show(staff_group)
- class abjad.score.TremoloContainer(count: int = 2, components=None, *, language: str = 'english', tag: Tag | None = None)[source]
Tremolo container.
>>> staff = abjad.Staff() >>> staff.append(abjad.TremoloContainer(2, "c'16 e'")) >>> staff.append("cs'4") >>> staff.append(abjad.TremoloContainer(2, "d'16 f'")) >>> staff.append("ds'4") >>> abjad.show(staff)
Duration of container equal to contents duration multiplied by count:
>>> abjad.get.duration(staff[0]) Duration(1, 4)
Duration of each leaf equal to written duration multiplied by count:
>>> abjad.get.duration(staff[0][0]) Duration(1, 8)
count
()Gets count.
- class abjad.score.Tuplet(ratio: tuple[int, int] | str | Ratio = '3:2', components=None, *, language: str = 'english', tag: Tag | None = None, tweaks: Tweak | None = None)[source]
Tuplet.
A tuplet:
>>> tuplet = abjad.Tuplet("6:4", "c'8 d'8 e'8") >>> abjad.show(tuplet)
Tweak tuplets like this:
>>> tuplet_1 = abjad.Tuplet("3:2", "c'4 ( d'4 e'4 )") >>> abjad.tweak(tuplet_1, r"\tweak color #red") >>> abjad.tweak(tuplet_1, r"\tweak staff-padding 2")
>>> tuplet_2 = abjad.Tuplet("3:2", "c'4 ( d'4 e'4 )") >>> abjad.tweak(tuplet_2, r"\tweak color #green") >>> abjad.tweak(tuplet_2, r"\tweak staff-padding 2")
>>> tuplet_3 = abjad.Tuplet("4:5", [tuplet_1, tuplet_2]) >>> abjad.tweak(tuplet_3, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.tweak(tuplet_3, r"\tweak color #blue") >>> abjad.tweak(tuplet_3, r"\tweak staff-padding 4")
>>> staff = abjad.Staff(r"\time 6/4 r4") >>> staff.append(tuplet_3) >>> score = abjad.Score([staff], name="Score") >>> abjad.show(staff)
append
(component, *[, language, ...])Appends
component
to tuplet.extend
(argument, *[, language, ...])Extends tuplet with
argument
.Is true when tuplet is rest-filled.
Is true when tuplet ratio reduces to 1:1.
Is true when tuplet can be rewritten with a ratio of 1:1.
Gets tuplet multiplier.
Normalizes tuplet ratio.
ratio
()Gets and sets tuplet ratio.
Rewrites dots of leaves in tuplet.
set_ratio
(ratio)Sets tuplet ratio.
Toggles tuplet prolation.
Rewrites tuplet with ratio of 1:1.
- overridden append(component: Component, *, language: str = 'english', preserve_duration: bool = False) None [source]
Appends
component
to tuplet.Appends note to tuplet:
>>> tuplet = abjad.Tuplet("3:2", "c'4 ( d'4 f'4 )") >>> abjad.show(tuplet)
>>> tuplet.append(abjad.Note("e'4")) >>> abjad.makers.tweak_tuplet_bracket_edge_height(tuplet) >>> abjad.show(tuplet)
Appends note to tuplet and changes tuplet ratio to preserve tuplet duration:
>>> tuplet = abjad.Tuplet("3:2", "c'4 ( d'4 f'4 )") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> voice = abjad.Voice([tuplet]) >>> abjad.show(voice)
>>> tuplet.append(abjad.Note("e'4"), preserve_duration=True) >>> abjad.show(voice)
- overridden extend(argument, *, language: str = 'english', preserve_duration: bool = False) None [source]
Extends tuplet with
argument
.Extends tuplet with three notes:
>>> tuplet = abjad.Tuplet("3:2", "c'4 ( d'4 f'4 )") >>> abjad.show(tuplet)
>>> notes = [abjad.Note("e'32"), abjad.Note("d'32"), abjad.Note("e'16")] >>> tuplet.extend(notes) >>> abjad.makers.tweak_tuplet_bracket_edge_height(tuplet) >>> abjad.show(tuplet)
Extends tuplet with three notes and preserves tuplet duration:
>>> tuplet = abjad.Tuplet("3:2", "c'4 ( d'4 f'4 )") >>> abjad.show(tuplet)
>>> notes = [abjad.Note("e'32"), abjad.Note("d'32"), abjad.Note("e'16")] >>> tuplet.extend(notes, preserve_duration=True) >>> abjad.show(tuplet)
- is_rest_filled() bool [source]
Is true when tuplet is rest-filled.
>>> tuplet = abjad.Tuplet("3:2", "r2 r2 r2") >>> abjad.show(tuplet)
>>> tuplet.is_rest_filled() True
- is_trivial() bool [source]
Is true when tuplet ratio reduces to 1:1.
>>> tuplet = abjad.Tuplet("1:1", "c'8 d'8 e'8") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
>>> tuplet.is_trivial() True
Is false when duration multiplier attaches to leaf in tuplet:
>>> tuplet = abjad.Tuplet("1:1", "c'8 d'8 e'8") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> tuplet[0].set_multiplier((2, 1)) >>> abjad.show(tuplet)
>>> tuplet.is_trivial() False
- is_trivializable() bool [source]
Is true when tuplet can be rewritten with a ratio of 1:1.
>>> tuplet = abjad.Tuplet("4:3", "c'4 c'4 c'4 c'4") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> staff = abjad.Staff([tuplet]) >>> score = abjad.Score([staff], name="Score") >>> abjad.attach(abjad.TimeSignature((3, 4)), tuplet[0]) >>> abjad.show(staff)
>>> tuplet.is_trivializable() True
>>> tuplet.trivialize() >>> abjad.show(staff)
>>> tuplet = abjad.Tuplet("5:3", "c'4 c'4 c'4 c'4 c'4") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> staff = abjad.Staff([tuplet]) >>> score = abjad.Score([staff], name="Score") >>> abjad.attach(abjad.TimeSignature((3, 4)), tuplet[0]) >>> abjad.show(staff)
>>> tuplet.is_trivializable() False
- multiplier() Fraction [source]
Gets tuplet multiplier.
>>> abjad.Tuplet("6:4", "c'4 d'4 e'4").multiplier() Fraction(2, 3)
- normalize_ratio() None [source]
Normalizes tuplet ratio.
>>> tuplet = abjad.Tuplet("3:1", "c'4 d' e'") >>> abjad.show(tuplet)
>>> tuplet.ratio().is_normalized() False
>>> tuplet.normalize_ratio() >>> abjad.show(tuplet)
>>> tuplet.ratio().is_normalized() True
>>> tuplet = abjad.Tuplet("3:8", "c'32 d'32 e'32") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
>>> tuplet.ratio().is_normalized() False
>>> tuplet.normalize_ratio() >>> abjad.show(tuplet)
>>> tuplet.ratio().is_normalized() True
>>> tuplet = abjad.Tuplet("12:5", "c'4 d'4 e'4") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
>>> tuplet.ratio().is_normalized() False
>>> tuplet.normalize_ratio() >>> abjad.show(tuplet)
>>> tuplet.ratio().is_normalized() True
- ratio() Ratio [source]
Gets and sets tuplet ratio.
>>> tuplet = abjad.Tuplet("3:2", "c'8 d'8 e'8") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
>>> tuplet.ratio() Ratio(numerator=3, denominator=2)
>>> tuplet.set_ratio(abjad.Ratio(6, 4)) >>> abjad.show(tuplet)
- rewrite_dots() None [source]
Rewrites dots of leaves in tuplet.
Not implemented for multiply nested tuplets.
Rewrites single dots as 3:2 prolation:
>>> tuplet = abjad.Tuplet("1:1", "c'8. c'8.") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
>>> tuplet.rewrite_dots() >>> abjad.show(tuplet)
Rewrites double dots as 7:4 prolation:
>>> tuplet = abjad.Tuplet("1:1", "c'8.. c'8..") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
>>> tuplet.rewrite_dots() >>> abjad.show(tuplet)
Does nothing when dot counts differ:
>>> tuplet = abjad.Tuplet("1:1", "c'8. d'8. e'8") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
>>> tuplet.rewrite_dots() >>> abjad.show(tuplet)
Does nothing when leaves carry no dots:
>>> tuplet = abjad.Tuplet("2:3", "c'8 d' e'") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
>>> tuplet.rewrite_dots() >>> abjad.show(tuplet)
- toggle_prolation() None [source]
Toggles tuplet prolation.
Not implemented for nested tuplets.
Changes augmented tuplet to diminished; that is, multiplies the written duration of the leaves in tuplet by the least power of
2
necessary to diminshed tuplet:>>> tuplet = abjad.Tuplet("3:4", "c'8 d'8 e'8") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
>>> tuplet.toggle_prolation() >>> abjad.show(tuplet)
Changes diminished tuplet to augmented; that is, divides the written duration of the leaves in tuplet by the least power of
2
necessary to diminshed tuplet.>>> tuplet = abjad.Tuplet("3:2", "c'4 d'4 e'4") >>> abjad.show(tuplet)
>>> tuplet.toggle_prolation() >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
Leaves trivial tuplets unchanged:
>>> tuplet = abjad.Tuplet("1:1", "c'4 d'4 e'4") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> abjad.show(tuplet)
>>> tuplet.toggle_prolation() >>> abjad.show(tuplet)
- trivialize() None [source]
Rewrites tuplet with ratio of 1:1.
>>> tuplet = abjad.Tuplet("4:3", "c'4 c'4 c'4 c'4") >>> abjad.tweak(tuplet, r"\tweak text #tuplet-number::calc-fraction-text") >>> staff = abjad.Staff([tuplet]) >>> score = abjad.Score([staff], name="Score") >>> abjad.attach(abjad.TimeSignature((3, 4)), tuplet[0]) >>> abjad.show(staff)
>>> tuplet.is_trivializable() True
>>> tuplet.trivialize() >>> abjad.show(staff)
- class abjad.score.Voice(components=None, *, language: str = 'english', lilypond_type: str = 'Voice', name: str | None = None, simultaneous: bool = False, tag: Tag | None = None)[source]
Voice.
Voice-contexted indicators like dynamics work with nested voices.
>>> voice = abjad.Voice("c'8 d'8 e'8 f'8") >>> abjad.show(voice)
Forte affects all red notes:
>>> outer_red_voice = abjad.Voice("e''8 d''", name="Red_Voice") >>> inner_red_voice = abjad.Voice("c''4 b' c''8", name="Red_Voice") >>> inner_blue_voice = abjad.Voice("e'4 f' e'8", name="Blue_Voice") >>> container = abjad.Container( ... [inner_red_voice, inner_blue_voice], ... simultaneous=True, ... ) >>> outer_red_voice.append(container) >>> outer_red_voice.extend("d''8") >>> abjad.override(outer_red_voice).NoteHead.color = "#red" >>> command = abjad.VoiceNumber(1) >>> abjad.attach(command, outer_red_voice[0]) >>> abjad.override(inner_blue_voice).NoteHead.color = "#blue" >>> command = abjad.VoiceNumber(2) >>> abjad.attach(command, inner_blue_voice[0]) >>> dynamic = abjad.Dynamic("f") >>> abjad.attach(dynamic, outer_red_voice[0]) >>> abjad.show(outer_red_voice)
>>> for leaf in abjad.iterate.leaves(outer_red_voice): ... dynamic = abjad.get.effective_indicator(leaf, abjad.Dynamic) ... print(leaf, dynamic) ... Note("e''8") Dynamic(name='f', command=None, leak=False, name_is_textual=False, ordinal=None) Note("d''8") Dynamic(name='f', command=None, leak=False, name_is_textual=False, ordinal=None) Note("c''4") Dynamic(name='f', command=None, leak=False, name_is_textual=False, ordinal=None) Note("b'4") Dynamic(name='f', command=None, leak=False, name_is_textual=False, ordinal=None) Note("c''8") Dynamic(name='f', command=None, leak=False, name_is_textual=False, ordinal=None) Note("e'4") None Note("f'4") None Note("e'8") None Note("d''8") Dynamic(name='f', command=None, leak=False, name_is_textual=False, ordinal=None)
Piano affects all blue notes:
>>> outer_red_voice = abjad.Voice("e''8 d''", name="Red_Voice") >>> inner_red_voice = abjad.Voice("c''4 b' c''8", name="Red_Voice") >>> inner_blue_voice = abjad.Voice("e'4 f' e'8", name="Blue_Voice") >>> container = abjad.Container( ... [inner_red_voice, inner_blue_voice], ... simultaneous=True, ... ) >>> outer_red_voice.append(container) >>> outer_red_voice.extend("d''8") >>> abjad.override(outer_red_voice).NoteHead.color = "#red" >>> command = abjad.VoiceNumber(1) >>> abjad.attach(command, outer_red_voice[0]) >>> abjad.override(inner_blue_voice).NoteHead.color = "#blue" >>> command = abjad.VoiceNumber(2) >>> abjad.attach(command, inner_blue_voice[0]) >>> dynamic = abjad.Dynamic("p") >>> abjad.attach(dynamic, inner_blue_voice[0]) >>> abjad.show(outer_red_voice)
>>> for leaf in abjad.iterate.leaves(outer_red_voice): ... dynamic = abjad.get.effective_indicator(leaf, abjad.Dynamic) ... print(leaf, dynamic) ... Note("e''8") None Note("d''8") None Note("c''4") None Note("b'4") None Note("c''8") None Note("e'4") Dynamic(name='p', command=None, leak=False, name_is_textual=False, ordinal=None) Note("f'4") Dynamic(name='p', command=None, leak=False, name_is_textual=False, ordinal=None) Note("e'8") Dynamic(name='p', command=None, leak=False, name_is_textual=False, ordinal=None) Note("d''8") None
Mezzoforte affects red notes from C4 forward:
>>> outer_red_voice = abjad.Voice("e''8 d''", name="Red_Voice") >>> inner_red_voice = abjad.Voice("c''4 b' c''8", name="Red_Voice") >>> inner_blue_voice = abjad.Voice("e'4 f' e'8", name="Blue_Voice") >>> container = abjad.Container( ... [inner_red_voice, inner_blue_voice], ... simultaneous=True, ... ) >>> outer_red_voice.append(container) >>> outer_red_voice.extend("d''8") >>> abjad.override(outer_red_voice).NoteHead.color = "#red" >>> command = abjad.VoiceNumber(1) >>> abjad.attach(command, outer_red_voice[0]) >>> abjad.override(inner_blue_voice).NoteHead.color = "#blue" >>> command = abjad.VoiceNumber(2) >>> abjad.attach(command, inner_blue_voice[0]) >>> dynamic = abjad.Dynamic("mf") >>> abjad.attach(dynamic, inner_red_voice[0]) >>> abjad.show(outer_red_voice)
>>> for leaf in abjad.iterate.leaves(outer_red_voice): ... dynamic = abjad.get.effective_indicator(leaf, abjad.Dynamic) ... print(leaf, dynamic) ... Note("e''8") None Note("d''8") None Note("c''4") Dynamic(name='mf', command=None, leak=False, name_is_textual=False, ordinal=None) Note("b'4") Dynamic(name='mf', command=None, leak=False, name_is_textual=False, ordinal=None) Note("c''8") Dynamic(name='mf', command=None, leak=False, name_is_textual=False, ordinal=None) Note("e'4") None Note("f'4") None Note("e'8") None Note("d''8") Dynamic(name='mf', command=None, leak=False, name_is_textual=False, ordinal=None)
Mezzoforte and piano set at the same time:
>>> outer_red_voice = abjad.Voice("e''8 d''", name="Red_Voice") >>> inner_red_voice = abjad.Voice("c''4 b' c''8", name="Red_Voice") >>> inner_blue_voice = abjad.Voice("e'4 f' e'8", name="Blue_Voice") >>> container = abjad.Container( ... [inner_red_voice, inner_blue_voice], ... simultaneous=True, ... ) >>> outer_red_voice.append(container) >>> outer_red_voice.extend("d''8") >>> abjad.override(outer_red_voice).NoteHead.color = "#red" >>> command = abjad.VoiceNumber(1) >>> abjad.attach(command, outer_red_voice[0]) >>> abjad.override(inner_blue_voice).NoteHead.color = "#blue" >>> command = abjad.VoiceNumber(2) >>> abjad.attach(command, inner_blue_voice[0]) >>> dynamic = abjad.Dynamic("mf") >>> abjad.attach(dynamic, inner_red_voice[0]) >>> dynamic = abjad.Dynamic("p") >>> abjad.attach(dynamic, inner_blue_voice[0]) >>> abjad.show(outer_red_voice)
>>> for leaf in abjad.iterate.leaves(outer_red_voice): ... dynamic = abjad.get.effective_indicator(leaf, abjad.Dynamic) ... print(leaf, dynamic) ... Note("e''8") None Note("d''8") None Note("c''4") Dynamic(name='mf', command=None, leak=False, name_is_textual=False, ordinal=None) Note("b'4") Dynamic(name='mf', command=None, leak=False, name_is_textual=False, ordinal=None) Note("c''8") Dynamic(name='mf', command=None, leak=False, name_is_textual=False, ordinal=None) Note("e'4") Dynamic(name='p', command=None, leak=False, name_is_textual=False, ordinal=None) Note("f'4") Dynamic(name='p', command=None, leak=False, name_is_textual=False, ordinal=None) Note("e'8") Dynamic(name='p', command=None, leak=False, name_is_textual=False, ordinal=None) Note("d''8") Dynamic(name='mf', command=None, leak=False, name_is_textual=False, ordinal=None)