.. _moduleTimespansNode:

music21.timespans.node
======================

.. WARNING: DO NOT EDIT THIS FILE:
   AUTOMATICALLY GENERATED.
   PLEASE EDIT THE .py FILE DIRECTLY.

.. automodule:: music21.timespans.node

TimespanTreeNode
----------------

.. autoclass:: music21.timespans.node.TimespanTreeNode

.. rubric:: :class:`~music21.timespans.node.TimespanTreeNode` bases

- :class:`~music21.timespans.core.AVLNode`
- :class:`~music21.common.objects.SlottedObject`

.. rubric:: :class:`~music21.timespans.node.TimespanTreeNode` methods

Methods inherited from :class:`~music21.timespans.core.AVLNode`:

.. hlist::
   :columns: 3

   - :meth:`~music21.timespans.core.AVLNode.debug`
   - :meth:`~music21.timespans.core.AVLNode.moveAttributes`
   - :meth:`~music21.timespans.core.AVLNode.rebalance`
   - :meth:`~music21.timespans.core.AVLNode.rotateLeftLeft`
   - :meth:`~music21.timespans.core.AVLNode.rotateLeftRight`
   - :meth:`~music21.timespans.core.AVLNode.rotateRightLeft`
   - :meth:`~music21.timespans.core.AVLNode.rotateRightRight`
   - :meth:`~music21.timespans.core.AVLNode.update`

.. rubric:: :class:`~music21.timespans.node.TimespanTreeNode` instance variables

.. attribute:: TimespanTreeNode.endTimeHigh

	
	The highest stop offset of any timespan in any node of the subtree
	rooted on this node.
	

.. attribute:: TimespanTreeNode.endTimeLow

	
	The lowest stop offset of any timespan in any node of the subtree
	rooted on this node.
	

.. attribute:: TimespanTreeNode.nodeStartIndex

	
	The timespan start index (i.e., the first x where s[x] is found in this Node's payload)
	of only those timespans stored in the payload of this node.
	

.. attribute:: TimespanTreeNode.nodeStopIndex

	
	The timespan stop index (i.e., the last x where s[x] is found in this Node's payload)
	of only those timespans stored in the payload of this node.
	

.. attribute:: TimespanTreeNode.payload

	
	The contents of the node at this point.  Usually ElementTimespans.
	
	>>> score = timespans.makeExampleScore()
	>>> tree = timespans.streamToTimespanTree(score, flatten=True,
	...                  classList=(note.Note, chord.Chord))
	>>> print(tree.rootNode.debug())
	<Node: Start:3.0 Indices:(0:5:6:12) Length:{1}>
	L: <Node: Start:1.0 Indices:(0:2:3:5) Length:{1}>
	L: <Node: Start:0.0 Indices:(0:0:2:2) Length:{2}>
	R: <Node: Start:2.0 Indices:(3:3:5:5) Length:{2}>
	R: <Node: Start:5.0 Indices:(6:8:9:12) Length:{1}>
	L: <Node: Start:4.0 Indices:(6:6:8:8) Length:{2}>
	R: <Node: Start:6.0 Indices:(9:9:11:12) Length:{2}>
	R: <Node: Start:7.0 Indices:(11:11:12:12) Length:{1}>
	
	>>> tree.rootNode.payload
	[<ElementTimespan (3.0 to 4.0) <music21.note.Note F>>]
	
	>>> tree.rootNode.leftChild.payload
	[<ElementTimespan (1.0 to 2.0) <music21.note.Note D>>]
	
	>>> for x in tree.rootNode.leftChild.rightChild.payload:
	...     x
	...
	<ElementTimespan (2.0 to 3.0) <music21.note.Note E>>
	<ElementTimespan (2.0 to 4.0) <music21.note.Note G>>
	
	>>> tree.rootNode.rightChild.payload
	[<ElementTimespan (5.0 to 6.0) <music21.note.Note A>>]
	

.. attribute:: TimespanTreeNode.subTreeStartIndex

	
	The lowest timespan start index of any timespan in any node of the
	subtree rooted on this node.
	

.. attribute:: TimespanTreeNode.subtreeStopIndex

	
	The highest timespan stop index of any timespan in any node of the
	subtree rooted on this node.
	

Instance variables inherited from :class:`~music21.timespans.core.AVLNode`:

.. hlist::
   :columns: 3

   - :attr:`~music21.timespans.core.AVLNode.balance`
   - :attr:`~music21.timespans.core.AVLNode.height`
   - :attr:`~music21.timespans.core.AVLNode.leftChild`
   - :attr:`~music21.timespans.core.AVLNode.position`
   - :attr:`~music21.timespans.core.AVLNode.rightChild`
