abjad.pcollections

abjad.pcollections.make_interval_class_vector(pitches)

Makes interval-class vector.

abjad.pcollections.voice_horizontally(pcs[, ...])

Voices named pcs with each pitch as close to the previous pitch as possible.

abjad.pcollections.voice_vertically(pcs[, ...])

Voices named pcs with each pitch not lower than the previous.

abjad.pcollections.PitchClassSegment([items])

Numbered pitch-class segment.

abjad.pcollections.PitchClassSet([argument])

Numbered pitch-class set.

abjad.pcollections.PitchRange([range_string])

Pitch range.

abjad.pcollections.PitchSegment([items])

Named pitch segment.

abjad.pcollections.PitchSet([argument])

Numbered pitch set.

abjad.pcollections.TwelveToneRow([items])

Twelve-tone row.

abjad.pcollections.make_interval_class_vector(pitches)[source]

Makes interval-class vector.

abjad.pcollections.voice_horizontally(pcs: Sequence[NamedPitchClass], initial_octave: Octave = Octave(number=4)) tuple[NamedPitch, ...][source]

Voices named pcs with each pitch as close to the previous pitch as possible.

>>> pcs = [abjad.NamedPitchClass(_) for _ in "c b d e f g e b a c".split()]
>>> pitches = abjad.pcollections.voice_horizontally(pcs)
>>> staff = abjad.Staff([abjad.Note(_, (1, 8)) for _ in pitches])
>>> abjad.show(staff)  
abjad.pcollections.voice_vertically(pcs: Sequence[NamedPitchClass], initial_octave: Octave = Octave(number=4)) tuple[NamedPitch, ...][source]

Voices named pcs with each pitch not lower than the previous.

>>> pcs = [abjad.NamedPitchClass(_) for _ in "c ef g bf d f af".split()]
>>> pitches = abjad.pcollections.voice_vertically(pcs)
>>> staff = abjad.Staff([abjad.Note(_, (1, 8)) for _ in pitches])
>>> abjad.show(staff)  
class abjad.pcollections.PitchClassSegment(items: Sequence = ())[source]

Numbered pitch-class segment.

>>> segment = abjad.PitchClassSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> segment
PitchClassSegment([10, 10.5, 6, 7, 10.5, 7])
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  

invert([axis])

Inverts numbered pitch-class segment.

multiply([n])

Multiplies pitch-classes in numbered pitch-class segment by n.

retrograde()

Gets retrograde of numbered pitch-class segment.

rotate([n])

Rotates numbered pitch-class segment by index n.

transpose([n])

Transposes numbered pitch-class segment by index n.

invert(axis=None) PitchClassSegment[source]

Inverts numbered pitch-class segment.

>>> segment = abjad.PitchClassSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> segment.invert()
PitchClassSegment([2, 1.5, 6, 5, 1.5, 5])
>>> segment.invert().invert()
PitchClassSegment([10, 10.5, 6, 7, 10.5, 7])
multiply(n=1) PitchClassSegment[source]

Multiplies pitch-classes in numbered pitch-class segment by n.

>>> segment = abjad.PitchClassSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> segment
PitchClassSegment([10, 10.5, 6, 7, 10.5, 7])
>>> segment.multiply(n=1)
PitchClassSegment([10, 10.5, 6, 7, 10.5, 7])
>>> segment.multiply(n=5)
PitchClassSegment([2, 4.5, 6, 11, 4.5, 11])
>>> segment.multiply(n=7)
PitchClassSegment([10, 1.5, 6, 1, 1.5, 1])
>>> segment.multiply(n=99)
PitchClassSegment([6, 7.5, 6, 9, 7.5, 9])
retrograde() PitchClassSegment[source]

Gets retrograde of numbered pitch-class segment.

>>> segment = abjad.PitchClassSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> segment.retrograde()
PitchClassSegment([7, 10.5, 7, 6, 10.5, 10])
>>> segment.retrograde().retrograde()
PitchClassSegment([10, 10.5, 6, 7, 10.5, 7])
rotate(n=0) PitchClassSegment[source]

Rotates numbered pitch-class segment by index n.

>>> segment = abjad.PitchClassSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> segment.rotate(n=1)
PitchClassSegment([7, 10, 10.5, 6, 7, 10.5])
>>> segment.rotate(n=-1)
PitchClassSegment([10.5, 6, 7, 10.5, 7, 10])
>>> segment.rotate(n=0)
PitchClassSegment([10, 10.5, 6, 7, 10.5, 7])
transpose(n=0) PitchClassSegment[source]

Transposes numbered pitch-class segment by index n.

>>> segment = abjad.PitchClassSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> segment.transpose(n=11)
PitchClassSegment([9, 9.5, 5, 6, 9.5, 6])
class abjad.pcollections.PitchClassSet(argument=())[source]

Numbered pitch-class set.

>>> set_ = abjad.PitchClassSet([-2, -1.5, 6, 7, -1.5, 7])
>>> set_
PitchClassSet([6, 7, 10, 10.5])
>>> str(set_)
'PC{6, 7, 10, 10.5}'
>>> abjad.NamedPitch("fs") in set_
False
>>> abjad.NamedPitch("f") in set_
False
>>> 6 in set_
False
>>> 5 in set_
False
>>> abjad.NumberedPitchClass(5) in set_
False
>>> abjad.NumberedPitchClass(6) in set_
True

Classical operators:

>>> set_1 = abjad.PitchClassSet([0, 2, 4, 5])
>>> set_2 = abjad.PitchClassSet([4, 5, 9])
>>> set_1 & set_2
PitchClassSet([4, 5])
>>> set_1 | set_2
PitchClassSet([0, 2, 4, 5, 9])
>>> set_1 ^ set_2
PitchClassSet([0, 2, 9])
>>> set_1 - set_2
PitchClassSet([0, 2])
>>> set_2 - set_1
PitchClassSet([9])

cardinality

difference(*arguments)

Return a new set with elements in the set that are not in the others.

get_normal_order()

Gets normal order.

get_prime_form([transposition_only])

Gets prime form.

intersection(*arguments)

Return a new set with elements common to the set and all others.

invert([axis])

Inverts pitch-class set.

multiply(n)

Multiplies pitch-class set by n.

symmetric_difference(*arguments)

Return a new set with elements in either the set or other but not both.

transpose([n])

Transposes all pitch-classes in pitch-class set by index n.

union(*arguments)

Return a new set with elements from the set and all others.

cardinality
overridden difference(*arguments)

Return a new set with elements in the set that are not in the others.

get_normal_order() PitchClassSegment[source]

Gets normal order.

Gets normal order of empty pitch-class set:

>>> pc_set = abjad.PitchClassSet()
>>> pc_set.get_normal_order()
PitchClassSegment([])

Gets normal order:

>>> pc_set = abjad.PitchClassSet([0, 1, 10, 11])
>>> pc_set.get_normal_order()
PitchClassSegment([10, 11, 0, 1])

Gets normal order:

>>> pc_set = abjad.PitchClassSet([2, 8, 9])
>>> pc_set.get_normal_order()
PitchClassSegment([8, 9, 2])

Gets normal order of pitch-class set with degree of symmetry equal to 2:

>>> pc_set = abjad.PitchClassSet([1, 2, 7, 8])
>>> pc_set.get_normal_order()
PitchClassSegment([1, 2, 7, 8])

Gets normal order of pitch-class set with degree of symmetry equal to 4:

>>> pc_set = abjad.PitchClassSet([0, 3, 6, 9])
>>> pc_set.get_normal_order()
PitchClassSegment([0, 3, 6, 9])
get_prime_form(transposition_only=False) PitchClassSet[source]

Gets prime form.

Gets prime form of empty pitch-class set:

>>> pc_set = abjad.PitchClassSet()
>>> pc_set.get_prime_form()
PitchClassSet([])
>>> pc_set = abjad.PitchClassSet()
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([])

Gets prime form:

>>> pc_set = abjad.PitchClassSet([0, 1, 10, 11])
>>> pc_set.get_prime_form()
PitchClassSet([0, 1, 2, 3])
>>> pc_set = abjad.PitchClassSet([0, 1, 10, 11])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 1, 2, 3])

Gets prime form:

>>> pc_set = abjad.PitchClassSet([2, 8, 9])
>>> pc_set.get_prime_form()
PitchClassSet([0, 1, 6])
>>> pc_set = abjad.PitchClassSet([2, 8, 9])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 1, 6])

Gets prime form of pitch-class set with degree of symmetry equal to 2:

>>> pc_set = abjad.PitchClassSet([1, 2, 7, 8])
>>> pc_set.get_prime_form()
PitchClassSet([0, 1, 6, 7])
>>> pc_set = abjad.PitchClassSet([1, 2, 7, 8])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 1, 6, 7])

Gets prime form of pitch-class set with degree of symmetry equal to 4:

>>> pc_set = abjad.PitchClassSet([0, 3, 6, 9])
>>> pc_set.get_prime_form()
PitchClassSet([0, 3, 6, 9])
>>> pc_set = abjad.PitchClassSet([0, 3, 6, 9])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 3, 6, 9])

Gets prime form of pitch-class that is not inversion-equivalent:

>>> pc_set = abjad.PitchClassSet([0, 4, 6, 7])
>>> pc_set.get_prime_form()
PitchClassSet([0, 1, 3, 7])
>>> pc_set = abjad.PitchClassSet([0, 4, 6, 7])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 4, 6, 7])

Gets prime form of inversionally nonequivalent pitch-class set:

>>> pc_set = abjad.PitchClassSet([0, 4, 7])
>>> pc_set.get_prime_form()
PitchClassSet([0, 3, 7])
>>> pc_set = abjad.PitchClassSet([0, 4, 7])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 4, 7])

REGRESSION:

>>> pc_set = abjad.PitchClassSet([0, 1, 2, 5, 8, 9])
>>> pc_set.get_prime_form()
PitchClassSet([0, 1, 2, 5, 6, 9])

REGRESSION:

>>> pc_set = abjad.PitchClassSet([0, 1, 2, 3, 6, 7])
>>> pc_set.get_prime_form()
PitchClassSet([0, 1, 2, 3, 6, 7])
overridden intersection(*arguments)

Return a new set with elements common to the set and all others.

invert(axis=None) PitchClassSet[source]

Inverts pitch-class set.

>>> abjad.PitchClassSet([-2, -1.5, 6, 7, -1.5, 7]).invert()
PitchClassSet([1.5, 2, 5, 6])
multiply(n) PitchClassSet[source]

Multiplies pitch-class set by n.

>>> abjad.PitchClassSet([-2, -1.5, 6, 7, -1.5, 7]).multiply(5)
PitchClassSet([2, 4.5, 6, 11])
overridden symmetric_difference(*arguments)

Return a new set with elements in either the set or other but not both.

transpose(n=0) PitchClassSet[source]

Transposes all pitch-classes in pitch-class set by index n.

>>> set_ = abjad.PitchClassSet([-2, -1.5, 6, 7, -1.5, 7])
>>> for n in range(12):
...     print(n, set_.transpose(n))
... 
0 PC{6, 7, 10, 10.5}
1 PC{7, 8, 11, 11.5}
2 PC{0, 0.5, 8, 9}
3 PC{1, 1.5, 9, 10}
4 PC{2, 2.5, 10, 11}
5 PC{0, 3, 3.5, 11}
6 PC{0, 1, 4, 4.5}
7 PC{1, 2, 5, 5.5}
8 PC{2, 3, 6, 6.5}
9 PC{3, 4, 7, 7.5}
10 PC{4, 5, 8, 8.5}
11 PC{5, 6, 9, 9.5}
overridden union(*arguments)

Return a new set with elements from the set and all others.

class abjad.pcollections.PitchRange(range_string='[A0, C8]')[source]

Pitch range.

Pitches from C3 to C7, inclusive:

>>> pitch_range = abjad.PitchRange("[C3, C7]")
>>> lilypond_file = abjad.illustrate(pitch_range)
>>> abjad.show(lilypond_file)  

range_string

Gets range string of pitch range.

start_pitch

Start pitch of pitch range.

stop_pitch

Stop pitch of pitch range.

voice_pitch_class(pitch_class)

Voices pitch_class.

range_string

Gets range string of pitch range.

>>> abjad.PitchRange("[C3, C7]").range_string
'[C3, C7]'
>>> abjad.PitchRange("[-inf, C7]").range_string
'[-inf, C7]'
>>> abjad.PitchRange("[C3, +inf]").range_string
'[C3, +inf]'
>>> abjad.PitchRange("[-inf, +inf]").range_string
'[-inf, +inf]'
start_pitch

Start pitch of pitch range.

>>> abjad.PitchRange("[C3, C7]").start_pitch
NamedPitch('c')
>>> abjad.PitchRange("[-inf, C7]").start_pitch is None
True
stop_pitch

Stop pitch of pitch range.

>>> abjad.PitchRange("[C3, C7]").stop_pitch
NamedPitch("c''''")
>>> abjad.PitchRange("[C8, +inf]").stop_pitch is None
True
voice_pitch_class(pitch_class)[source]

Voices pitch_class.

Voices C three times:

>>> pitch_range = abjad.PitchRange("[C4, C6]")
>>> pitch_range.voice_pitch_class("c")
(NamedPitch("c'"), NamedPitch("c''"), NamedPitch("c'''"))

Voices B two times:

>>> pitch_range = abjad.PitchRange("[C4, C6]")
>>> pitch_range.voice_pitch_class("b")
(NamedPitch("b'"), NamedPitch("b''"))

Returns empty because B can not voice:

>>> pitch_range = abjad.PitchRange("[C4, A4)")
>>> pitch_range.voice_pitch_class("b")
()
class abjad.pcollections.PitchSegment(items: Sequence = ())[source]

Named pitch segment.

>>> segment = abjad.PitchSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> str(segment)
'<-2, -1.5, 6, 7, -1.5, 7>'
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  

invert([axis])

Inverts named pitch segment about axis.

multiply([n])

Multiplies pitch segment by index n.

retrograde()

Retrograde of pitch segment.

rotate([n])

Rotates pitch segment by index n.

transpose([n])

Transposes pitch segment by index n.

invert(axis=None) PitchSegment[source]

Inverts named pitch segment about axis.

>>> segment = abjad.PitchSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  
>>> segment = segment.invert(axis=0)
>>> str(segment)
'<2, 1.5, -6, -7, 1.5, -7>'
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  
multiply(n=1) PitchSegment[source]

Multiplies pitch segment by index n.

>>> segment = abjad.PitchSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  
>>> segment = segment.multiply(n=3)
>>> str(segment)
'<-6, -4.5, 18, 21, -4.5, 21>'
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  
retrograde() PitchSegment[source]

Retrograde of pitch segment.

>>> segment = abjad.PitchSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  
>>> segment = segment.retrograde()
>>> str(segment)
'<7, -1.5, 7, 6, -1.5, -2>'
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  
rotate(n=0) PitchSegment[source]

Rotates pitch segment by index n.

>>> segment = abjad.PitchSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  
>>> segment = segment.rotate(n=1)
>>> str(segment)
'<7, -2, -1.5, 6, 7, -1.5>'
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  
transpose(n=0) PitchSegment[source]

Transposes pitch segment by index n.

>>> segment = abjad.PitchSegment([-2, -1.5, 6, 7, -1.5, 7])
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  
>>> segment = segment.transpose(n=11)
>>> str(segment)
'<9, 9.5, 17, 18, 9.5, 18>'
>>> lilypond_file = abjad.illustrate(segment)
>>> abjad.show(lilypond_file)  
class abjad.pcollections.PitchSet(argument=())[source]

Numbered pitch set.

>>> set_1 = abjad.PitchSet([-26, -2.5, 6, 7, -1.5, 7])
>>> set_2 = abjad.PitchSet([-1.5, 7, 9, 12])
>>> set_1
PitchSet([-26, -2.5, -1.5, 6, 7])
>>> set_2
PitchSet([-1.5, 7, 9, 12])
>>> str(set_1)
'{-26, -2.5, -1.5, 6, 7}'
>>> str(set_2)
'{-1.5, 7, 9, 12}'
>>> -1.5 in set_1
False
>>> abjad.NumberedPitch(-1.5) in set_1
True
>>> abjad.NumberedPitch("aqs") in set_2
False
>>> len(set_1)
5
>>> len(set_2)
4

Classical operators:

>>> set_1 = abjad.PitchSet([-26, -2.5, 6, 7, -1.5, 7])
>>> set_2 = abjad.PitchSet([-1.5, 7, 9, 12])
>>> set_1 & set_2
PitchSet([-1.5, 7])
>>> set_2 & set_1
PitchSet([-1.5, 7])
>>> set_1.intersection(set_2)
PitchSet([-1.5, 7])
>>> set_2.intersection(set_1)
PitchSet([-1.5, 7])
>>> set_1 | set_2
PitchSet([-26, -2.5, -1.5, 6, 7, 9, 12])
>>> set_2 | set_1
PitchSet([-26, -2.5, -1.5, 6, 7, 9, 12])
>>> set_1.union(set_2)
PitchSet([-26, -2.5, -1.5, 6, 7, 9, 12])
>>> set_2.union(set_1)
PitchSet([-26, -2.5, -1.5, 6, 7, 9, 12])
>>> set_1 - set_2
PitchSet([-26, -2.5, 6])
>>> set_1.difference(set_2)
PitchSet([-26, -2.5, 6])
>>> set_2 - set_1
PitchSet([9, 12])
>>> set_2.difference(set_1)
PitchSet([9, 12])
>>> set_1 ^ set_2
PitchSet([-26, -2.5, 6, 9, 12])
>>> set_2 ^ set_1
PitchSet([-26, -2.5, 6, 9, 12])
>>> set_1.symmetric_difference(set_2)
PitchSet([-26, -2.5, 6, 9, 12])
>>> set_2.symmetric_difference(set_1)
PitchSet([-26, -2.5, 6, 9, 12])

Predicates:

>>> set_1 = abjad.PitchSet([-6, -5, -3, -1])
>>> set_2 = abjad.PitchSet([-3, -1])
>>> set_3 = abjad.PitchSet([1, 3, 4])
>>> set_1.isdisjoint(set_3)
True
>>> set_2.issubset(set_1)
True
>>> set_1.issuperset(set_2)
True

Comparison:

>>> set_1 = abjad.PitchSet([-26, -2.5, 6, 7, -1.5, 7])
>>> set_2 = abjad.PitchSet([-1.5, 7, 9, 12])
>>> set_1 == set_1
True
>>> set_1 == set_2
False
>>> set_1 < set_1
False
>>> set_1 < set_2
False
>>> set_1 <= set_1
True
>>> set_1 <= set_2
False
>>> set_1 > set_1
False
>>> set_1 > set_2
False
>>> set_1 >= set_1
True
>>> set_1 >= set_2
False

Copy:

>>> import copy
>>> set_1_copy = copy.copy(set_1)
>>> set_1_copy
PitchSet([-26, -2.5, -1.5, 6, 7])
>>> set_1 == set_1_copy
True

Empty set:

>>> set_ = abjad.PitchSet()
>>> set_
PitchSet()
>>> str(set_)
'{}'
>>> len(set_)
0
>>> bool(set_)
False

difference(*arguments)

Return a new set with elements in the set that are not in the others.

intersection(*arguments)

Return a new set with elements common to the set and all others.

symmetric_difference(*arguments)

Return a new set with elements in either the set or other but not both.

union(*arguments)

Return a new set with elements from the set and all others.

overridden difference(*arguments)

Return a new set with elements in the set that are not in the others.

overridden intersection(*arguments)

Return a new set with elements common to the set and all others.

overridden symmetric_difference(*arguments)

Return a new set with elements in either the set or other but not both.

overridden union(*arguments)

Return a new set with elements from the set and all others.

class abjad.pcollections.TwelveToneRow(items: Any = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))[source]

Twelve-tone row.

Initializes from defaults:

>>> row = abjad.TwelveToneRow()
>>> lilypond_file = abjad.illustrate(row)
>>> abjad.show(lilypond_file)  

Initializes from integers:

>>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0]
>>> row = abjad.TwelveToneRow(numbers)
>>> lilypond_file = abjad.illustrate(row)
>>> abjad.show(lilypond_file)  

Interpreter representation:

>>> row
TwelveToneRow(items=(NumberedPitchClass(1), NumberedPitchClass(11), NumberedPitchClass(9), NumberedPitchClass(3), NumberedPitchClass(6), NumberedPitchClass(7), NumberedPitchClass(5), NumberedPitchClass(4), NumberedPitchClass(10), NumberedPitchClass(2), NumberedPitchClass(8), NumberedPitchClass(0)))

invert([axis])

Inverts row about optional axis.

multiply([n])

Multiplies pitch-classes in row by n.

retrograde()

Gets retrograde of row.

rotate([n])

Rotates row by index n.

transpose([n])

Transposes row by index n.

overridden invert(axis=None) TwelveToneRow[source]

Inverts row about optional axis.

Example row:

>>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0]
>>> row = abjad.TwelveToneRow(numbers)
>>> lilypond_file = abjad.illustrate(row)
>>> abjad.show(lilypond_file)  

Inverts row about first pitch-class when axis is none:

>>> inversion = row.invert()
>>> lilypond_file = abjad.illustrate(inversion)
>>> abjad.show(lilypond_file)  

First pitch-classes are equal:

>>> row[0] == inversion[0]
True

Inverts row about pitch-class 1; same result as above:

>>> inversion = row.invert(axis=1)
>>> lilypond_file = abjad.illustrate(inversion)
>>> abjad.show(lilypond_file)  

Inverts row about pitch-class 0:

>>> inversion = row.invert(axis=0)
>>> lilypond_file = abjad.illustrate(inversion)
>>> abjad.show(lilypond_file)  

Inverts row about pitch-class 5:

>>> inversion = row.invert(axis=5)
>>> lilypond_file = abjad.illustrate(inversion)
>>> abjad.show(lilypond_file)  
overridden multiply(n=1) TwelveToneRow[source]

Multiplies pitch-classes in row by n.

Example row:

>>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0]
>>> row = abjad.TwelveToneRow(numbers)
>>> lilypond_file = abjad.illustrate(row)
>>> abjad.show(lilypond_file)  

Multiplies pitch-classes in row by 5:

>>> multiplication = row.multiply(n=5)
>>> lilypond_file = abjad.illustrate(multiplication)
>>> abjad.show(lilypond_file)  

Multiplies pitch-classes in row by 7:

>>> multiplication = row.multiply(n=7)
>>> lilypond_file = abjad.illustrate(multiplication)
>>> abjad.show(lilypond_file)  

Multiplies pitch-classes in row by 1:

>>> multiplication = row.multiply(n=1)
>>> lilypond_file = abjad.illustrate(multiplication)
>>> abjad.show(lilypond_file)  
overridden retrograde() TwelveToneRow[source]

Gets retrograde of row.

Example row:

>>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0]
>>> row = abjad.TwelveToneRow(numbers)
>>> lilypond_file = abjad.illustrate(row)
>>> abjad.show(lilypond_file)  

Gets retrograde of row:

>>> retrograde = row.retrograde()
>>> lilypond_file = abjad.illustrate(retrograde)
>>> abjad.show(lilypond_file)  

Gets retrograde of retrograde of row:

>>> retrograde = row.retrograde().retrograde()
>>> lilypond_file = abjad.illustrate(retrograde)
>>> abjad.show(lilypond_file)  
>>> retrograde == row
True
overridden rotate(n=0) TwelveToneRow[source]

Rotates row by index n.

Example row:

>>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0]
>>> row = abjad.TwelveToneRow(numbers)
>>> lilypond_file = abjad.illustrate(row)
>>> abjad.show(lilypond_file)  

Rotates row to the right:

>>> rotation = row.rotate(n=1)
>>> lilypond_file = abjad.illustrate(rotation)
>>> abjad.show(lilypond_file)  

Rotates row to the left:

>>> rotation = row.rotate(n=-1)
>>> lilypond_file = abjad.illustrate(rotation)
>>> abjad.show(lilypond_file)  

Rotates row by zero:

>>> rotation = row.rotate(n=0)
>>> lilypond_file = abjad.illustrate(rotation)
>>> abjad.show(lilypond_file)  
>>> rotation == row
True
overridden transpose(n=0) TwelveToneRow[source]

Transposes row by index n.

Example row:

>>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0]
>>> row = abjad.TwelveToneRow(numbers)
>>> lilypond_file = abjad.illustrate(row)
>>> abjad.show(lilypond_file)  

Transposes row by positive index:

>>> transposition = row.transpose(n=13)
>>> lilypond_file = abjad.illustrate(transposition)
>>> abjad.show(lilypond_file)  

Transposes row by negative index:

>>> transposition = row.transpose(n=-13)
>>> lilypond_file = abjad.illustrate(transposition)
>>> abjad.show(lilypond_file)  

Transposes row by zero index:

>>> transposition = row.transpose(n=0)
>>> lilypond_file = abjad.illustrate(transposition)
>>> abjad.show(lilypond_file)  
>>> transposition == row
True