FoscPitchClassSet

Returns a FoscPitchClassSet.


Description

Pitch-class set.


Attributes Summary

Class Methods

*newFromSelection Makes pitch-class set from selection.

Instance Methods: Special Methods

includes (abjad: contains)
hash Hashes pitch-class set.
illustrate Illustrates pitch-class set.
str Gets string representation of pitch-class set.

Instance Methods

difference Set-theoretic difference of receiver and expr.
sect Set-theoretic intersection of receiver and expr.
isDisjoint Is true when typed receiver shares no elements with expr. Otherwise false.
isEmpty Is true when pitch class set is empty.
isSubsetOf Is true when receiver is a subset of expr. Otherwise false.
isSupersetOf Is true when receiver is a superset of expr. Otherwise false.
notEmpty Is true when set is not empty.
symmetricDifference Symmetric difference of receiver and expr.
union Union of receiver and expr.
normalOrder Gets normal order.
primeForm Gets prime form.
invert Inverts pitch-class set.
isTransposedSubset Is true when pitch-class set is transposed subset of pcset. Otherwise false.
isTransposedSuperset Is true when pitch-class set is transposed superset of pcset. Otherwise false.
multiply Multiplies pitch-class set by n.
orderBy Orders pitch-class set by pitch-class segment.
transpose Transposes all pitch-classes in pitch-class set by index n.


Usage

  1. Example

    a = FoscPitchClassSet[0, 2, 4, 8];
    a = FoscPitchClassSet(#[0, 2, 4, 8]);
    a.items;
    [ FoscPitchClass.new, FoscPitchClass.new, FoscPitchClass.new, FoscPitchClass.new ]
    a = FoscPitchClassSet([0, 2, 4, 8]);
    b = FoscPitchClassSet([1, 3, 4, 8]);
    a.sect(b).items.collect { |each| each.pitchClassNumber };
    [ 4.0, 8.0 ]
    b = FoscPitchSet([60, 61, 62]);
    a = FoscPitchClassSet(b);
    a.items.collect { |each| each.pitchClassNumber };
    [ 0.0, 1.0, 2.0 ]


Class Methods


*newFromSelection

Makes pitch-class set from selection.

Returns pitch-class set.


Instance Methods: Special Methods


includes

(abjad: contains)

Is true when pitch-class set contains argument. Otherwise false.

Returns true or false.


hash

Hashes pitch-class set.

Returns integer.


illustrate

Illustrates pitch-class set.


str

Gets string representation of pitch-class set.

Returns string.


Instance Methods


difference

Set-theoretic difference of receiver and expr.

Returns new pitch class set.


sect

Set-theoretic intersection of receiver and expr.

Returns new pitch class set.


isDisjoint

Is true when typed receiver shares no elements with expr. Otherwise false.

Returns boolean.

  1. Example

    a = FoscPitchClassSet([1, 2, 3], Number);
    b = FoscPitchClassSet([4], Number);
    c = FoscPitchClassSet([3, 4], Number);
    isDisjoint(a, b);
    true
    isDisjoint(a, c);
    false


isEmpty

Is true when pitch class set is empty.

Returns boolean.

  1. Example

    a = FoscPitchClassSet([1, 2, 3], Number);
    a.isEmpty;
    false
    a = FoscPitchClassSet([], Number);
    a.isEmpty;
    true


isSubsetOf

Is true when receiver is a subset of expr. Otherwise false.

Returns boolean.

  1. Example

    a = FoscPitchClassSet([1, 2, 3]);
    b = FoscPitchClassSet([2, 3]);
    a.isSubsetOf(b);
    false
    b.isSubsetOf(a);
    true


isSupersetOf

Is true when receiver is a superset of expr. Otherwise false.

Returns boolean.

  1. Example

    a = FoscPitchClassSet([1, 2, 3]);
    b = FoscPitchClassSet([2, 3]);
    a.isSupersetOf(b);
    true
    b.isSupersetOf(a);
    false


notEmpty

Is true when set is not empty.

Returns boolean.

  1. Example

    a = FoscPitchClassSet([1, 2, 3], Number);
    a.notEmpty;
    true
    a = FoscPitchClassSet([], Number);
    a.notEmpty;
    false


symmetricDifference

Symmetric difference of receiver and expr.

Returns new pitch class set.

  1. Example

    a = FoscPitchClassSet([1, 2, 3]);
    b = FoscPitchClassSet([2, 3, 4]);
    a.symmetricDifference(b).collect { |each| each.pitchClassNumber };


union

Union of receiver and expr.

Returns new pitch class set.

  1. Example

    a = FoscPitchClassSet([1, 2, 3]);
    b = FoscPitchClassSet([2, 3, 4]);
    a.union(b).items.collect { |each| each.pitchClassNumber };
    [ 1.0, 2.0, 3.0, 4.0 ]


normalOrder

Gets normal order.

Returns pitch-class segment.


primeForm

Gets prime form.

Returns new pitch-class set.


invert

Inverts pitch-class set.

Returns numbered pitch-class set.


isTransposedSubset

Is true when pitch-class set is transposed subset of pcset. Otherwise false.

Returns true or false.


isTransposedSuperset

Is true when pitch-class set is transposed superset of pcset. Otherwise false.

Returns true or false.


multiply

Multiplies pitch-class set by n.

Returns new pitch-class set.


orderBy

Orders pitch-class set by pitch-class segment.

Returns pitch-class segment.


transpose

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

Returns new pitch-class set.