clonewp.by_leaf_counts_with_parentage — Abjad v1.1.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Project Abjad »
- Abjad v1.1.1 documentation »
- Abjad API »

# clonewp.by_leaf_counts_with_parentage

`abjad.tools.clonewp.` `by_leaf_counts_with_parentage`(container, leaf_counts)

  container is any Abjad container to partition. leaf_counts is a Python list of zero or more positive integers.

  Partition container and all components in parentage of container. Do not act in place. Instead, return list of parts equal in number to len(leaf_counts).

  The function wraps lcopy( ). This means that the original structure remains unchanged. Also that resulting parts cut all the way up into voice.

  Example:

      t = Voice([FixedDurationTuplet((2, 8), construct.scale(3))])
      Beam(t[0][:])
      left, right = containertools.partition_by_leaf_counts_with_parentage(t[0], [1, 2])

      left:

      \new Voice {
              \times 2/3 {
                      c'8 [ ]
              }
      }

      right:

      \new Voice {
              \times 2/3 {
                      d'8 [
                      e'8 ]
              }
      }

### Navigation

- index
- modules |
- next |
- previous |
- Project Abjad »
- Abjad v1.1.1 documentation »
- Abjad API »