IntervalSet¶
-
class
abjad.pitch.IntervalSet.
IntervalSet
(items=None, item_class=None)¶ Interval set.
Attributes Summary
from_selection
Initializes interval set from component selection. Special methods
-
(
TypedFrozenset
).__and__
(argument)¶ Logical AND of typed frozen set and
argument
.Returns new typed frozen set.
-
(
TypedCollection
).__contains__
(item)¶ Is true when typed collection contains
item
.Returns true or false.
-
(
TypedCollection
).__eq__
(argument)¶ Is true when
argument
is a typed collection with items that compare equal to those of this typed collection.Returns true or false.
-
(
AbjadObject
).__format__
(format_specification='')¶ Formats Abjad object.
Set
format_specification
to''
or'storage'
. Interprets''
equal to'storage'
.Returns string.
-
(
TypedFrozenset
).__ge__
(argument)¶ Is true when typed frozen set is greater than or equal to
argument
.Returns true or false.
-
(
TypedFrozenset
).__gt__
(argument)¶ Is true when typed frozen set is greater than
argument
.Returns true or false.
-
(
TypedFrozenset
).__hash__
()¶ Hashes typed frozen set.
Returns integer.
-
(
TypedCollection
).__iter__
()¶ Iterates typed collection.
Returns generator.
-
(
TypedFrozenset
).__le__
(argument)¶ Is true when typed frozen set is less than or equal to
argument
.Returns true or false.
-
(
TypedCollection
).__len__
()¶ Gets length of typed collection.
Returns nonnegative integer.
-
(
TypedFrozenset
).__lt__
(argument)¶ Is true when typed frozen set is less than
argument
.Returns true or false.
-
(
TypedFrozenset
).__or__
(argument)¶ Logical OR of typed frozen set and
argument
.Returns new typed frozen set.
-
(
AbjadObject
).__repr__
()¶ Gets interpreter representation of Abjad object.
Returns string.
-
(
TypedFrozenset
).__sub__
(argument)¶ Subtracts
argument
from typed frozen set.Returns new typed frozen set.
-
(
TypedFrozenset
).__xor__
(argument)¶ Logical XOR of typed frozen set and
argument
.Returns new typed frozen set.
Methods
-
(
TypedFrozenset
).copy
()¶ Copies typed frozen set.
Returns new typed frozen set.
-
(
TypedFrozenset
).difference
(argument)¶ Typed frozen set set-minus
argument
.Returns new typed frozen set.
-
(
TypedFrozenset
).intersection
(argument)¶ Set-theoretic intersection of typed frozen set and
argument
.Returns new typed frozen set.
-
(
TypedFrozenset
).isdisjoint
(argument)¶ Is true when typed frozen set shares no elements with
argument
.Returns true or false.
-
(
TypedFrozenset
).issubset
(argument)¶ Is true when typed frozen set is a subset of
argument
.Returns true or false.
-
(
TypedFrozenset
).issuperset
(argument)¶ Is true when typed frozen set is a superset of
argument
.Returns true or false.
-
(
TypedFrozenset
).symmetric_difference
(argument)¶ Symmetric difference of typed frozen set and
argument
.Returns new typed frozen set.
-
(
TypedFrozenset
).union
(argument)¶ Union of typed frozen set and
argument
.Returns new typed frozen set.
Class & static methods
-
classmethod
from_selection
(selection, item_class=None)¶ Initializes interval set from component selection.
>>> staff_1 = abjad.Staff("c'4 <d' fs' a'>4 b2") >>> staff_2 = abjad.Staff("c4. r8 g2") >>> selection = abjad.select((staff_1, staff_2)) >>> intervals = abjad.IntervalSet.from_selection(selection) >>> for interval in sorted(intervals): ... interval ... NamedInterval('-M6') NamedInterval('-P5') NamedInterval('-A4') NamedInterval('-M3') NamedInterval('-m3') NamedInterval('-M2') NamedInterval('+m2') NamedInterval('+m3') NamedInterval('+M3') NamedInterval('+P4') NamedInterval('+P5') NamedInterval('+m7') NamedInterval('+M7') NamedInterval('+P8') NamedInterval('+M9') NamedInterval('+A11') NamedInterval('+M13')
Returns interval set.
Read-only properties
-
(
TypedCollection
).item_class
¶ Gets item class of collection.
Collection coerces items according to
item_class
.Returns class.
-
(
TypedCollection
).items
¶ Gets items in collection.
Returns list.
-