QGridLeaf

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.rhythmtrees" { graph [label="abjad.rhythmtrees"]; node [color=1]; "abjad.rhythmtrees.RhythmTreeMixin" [URL="../api/abjadext/nauert/../../abjad/rhythmtrees.html#abjad.rhythmtrees.RhythmTreeMixin", label="Rhythm\nTree\nMixin", shape=oval, style=bold, target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjadext/nauert/../../abjad/system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; } subgraph "cluster_abjadext.nauert" { graph [label="abjadext.nauert"]; node [color=3]; "abjadext.nauert.QGridLeaf.QGridLeaf" [URL="../api/abjadext/nauert/QGridLeaf.html#abjadext.nauert.QGridLeaf.QGridLeaf", color=black, fontcolor=white, label="QGrid\nLeaf", target=_top]; } subgraph cluster_builtins { graph [label=builtins]; node [color=4]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } subgraph "cluster_uqbar.containers" { graph [label="uqbar.containers"]; node [color=5]; "uqbar.containers.UniqueTreeNode.UniqueTreeNode" [label="Unique\nTree\nNode"]; } "abjad.rhythmtrees.RhythmTreeMixin" -> "abjadext.nauert.QGridLeaf.QGridLeaf"; "abjad.system.AbjadObject.AbjadObject" -> "abjad.rhythmtrees.RhythmTreeMixin"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; "builtins.object" -> "uqbar.containers.UniqueTreeNode.UniqueTreeNode"; "uqbar.containers.UniqueTreeNode.UniqueTreeNode" -> "abjadext.nauert.QGridLeaf.QGridLeaf"; }

class abjadext.nauert.QGridLeaf.QGridLeaf(preprolated_duration=1, q_event_proxies=None, is_divisible=True)

Q-grid leaf.

>>> leaf = abjadext.nauert.QGridLeaf()
>>> leaf
QGridLeaf(
    preprolated_duration=Duration(1, 1),
    is_divisible=True
    )

Used internally by QGrid.


Attributes Summary

__call__ Calls q-grid leaf.
__graph__ Graphviz graph of q-grid leaf.
is_divisible Flag for whether the node may be further divided under some search tree.
preceding_q_event_proxies Preceding q-event proxies of q-grid leaf.
q_event_proxies Q-event proxies of q-grid leaf.
rtm_format RTM format of q-grid leaf.
succeeding_q_event_proxies Succeeding q-event proxies of q-grid leaf.

Special methods

__call__(pulse_duration)

Calls q-grid leaf.

Returns selection of notes.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to '' or 'storage'. Interprets '' equal to 'storage'.

Returns string.

__graph__(**keywords)

Graphviz graph of q-grid leaf.

Returns Graphviz graph.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.


Methods

(UniqueTreeNode).precede_by(expr)
(UniqueTreeNode).replace_with(expr)
(UniqueTreeNode).succeed_by(expr)

Read/write properties

is_divisible

Flag for whether the node may be further divided under some search tree.

(UniqueTreeNode).name
(RhythmTreeMixin).preprolated_duration

The node’s preprolated_duration in pulses:

>>> node = abjad.rhythmtrees.RhythmTreeLeaf(
...     preprolated_duration=1)
>>> node.preprolated_duration
Duration(1, 1)
>>> node.preprolated_duration = 2
>>> node.preprolated_duration
Duration(2, 1)

Returns int.


Read-only properties

(UniqueTreeNode).depth
(RhythmTreeMixin).duration

The preprolated_duration of the node:

>>> rtm = '(1 ((1 (1 1)) (1 (1 1))))'
>>> tree = abjad.rhythmtrees.RhythmTreeParser()(rtm)[0]
>>> tree.duration
Duration(1, 1)
>>> tree[1].duration
Duration(1, 2)
>>> tree[1][1].duration
Duration(1, 4)

Return Duration instance.

(UniqueTreeNode).graph_order
(UniqueTreeNode).parent
(UniqueTreeNode).parentage
(RhythmTreeMixin).parentage_ratios

A sequence describing the relative durations of the nodes in a node’s improper parentage.

The first item in the sequence is the preprolated_duration of the root node, and subsequent items are pairs of the preprolated duration of the next node in the parentage and the total preprolated_duration of that node and its siblings:

>>> a = abjad.rhythmtrees.RhythmTreeContainer(preprolated_duration=1)
>>> b = abjad.rhythmtrees.RhythmTreeContainer(preprolated_duration=2)
>>> c = abjad.rhythmtrees.RhythmTreeLeaf(preprolated_duration=3)
>>> d = abjad.rhythmtrees.RhythmTreeLeaf(preprolated_duration=4)
>>> e = abjad.rhythmtrees.RhythmTreeLeaf(preprolated_duration=5)
>>> a.extend([b, c])
>>> b.extend([d, e])
>>> a.parentage_ratios
(Duration(1, 1),)
>>> b.parentage_ratios
(Duration(1, 1), (Duration(2, 1), Duration(5, 1)))
>>> c.parentage_ratios
(Duration(1, 1), (Duration(3, 1), Duration(5, 1)))
>>> d.parentage_ratios
(Duration(1, 1), (Duration(2, 1), Duration(5, 1)), (Duration(4, 1), Duration(9, 1)))
>>> e.parentage_ratios
(Duration(1, 1), (Duration(2, 1), Duration(5, 1)), (Duration(5, 1), Duration(9, 1)))

Returns tuple.

preceding_q_event_proxies

Preceding q-event proxies of q-grid leaf.

Returns list.

(RhythmTreeMixin).pretty_rtm_format

The node’s pretty-printed RTM format:

>>> rtm = '(1 ((1 (1 1)) (1 (1 1))))'
>>> tree = abjad.rhythmtrees.RhythmTreeParser()(rtm)[0]
>>> print(tree.pretty_rtm_format)
(1 (
    (1 (
        1
        1))
    (1 (
        1
        1))))

Returns string.

(RhythmTreeMixin).prolation

Prolation of rhythm tree node.

Returns multiplier.

(RhythmTreeMixin).prolations

Prolations of rhythm tree node.

Returns tuple.

q_event_proxies

Q-event proxies of q-grid leaf.

(UniqueTreeNode).root
rtm_format

RTM format of q-grid leaf.

(RhythmTreeMixin).start_offset

The starting offset of a node in a rhythm-tree relative the root.

>>> rtm = '(1 ((1 (1 1)) (1 (1 1))))'
>>> tree = abjad.rhythmtrees.RhythmTreeParser()(rtm)[0]
>>> tree.start_offset
Offset(0, 1)
>>> tree[1].start_offset
Offset(1, 2)
>>> tree[0][1].start_offset
Offset(1, 4)

Returns Offset instance.

(RhythmTreeMixin).stop_offset

The stopping offset of a node in a rhythm-tree relative the root.

succeeding_q_event_proxies

Succeeding q-event proxies of q-grid leaf.

Returns list.