Returns a FoscPitchSet.
A pitch set.
NB: abjad.PitchSet subclasses from Set not TypedSet
| pitchNumbers | |
| pitchNames | |
| 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. |
| invert | |
| isEquivalentUnderTransposition | True if receiver is equivalent to pitchSet under transposition. |
| register | Registers pitchClasses by pitch set. |
| transpose | Transposes all pitches in pitch set by semitones. |
| illustrate | |
| play |
Example
x = FoscPitchSet(#[60,61,62]);
x.cs;FoscPitchSet([
FoscPitch('C4'),
FoscPitch('C#4'),
FoscPitch('D4')
])
x.size;3
x.pitchNumbers;[ 60.0, 61.0, 62.0 ]
x.pitchNames;[ "C4", "C#4", "D4" ]Set-theoretic difference of receiver and expr.
Returns new pitch class set.
Example
a = FoscPitchSet(#[61,62,63]);
b = FoscPitchSet(#[62,63,64]);
a.difference(b).items.collect { |each| each.pitchNumber };[ 61.0 ]Set-theoretic intersection of receiver and expr.
Returns new pitch class set.
Example
a = FoscPitchSet(#[61,62,63]);
b = FoscPitchSet(#[62,63,64]);
a.sect(b).items.collect { |each| each.pitchNumber };[ 62.0, 63.0 ]Is true when typed receiver shares no elements with expr. Otherwise false.
Returns boolean.
Example
a = FoscPitchSet(#[60,61]);
b = FoscPitchSet(#[61,62,63]);
c = FoscPitchSet(#[64,65]);
a.isDisjoint(a);false
a.isDisjoint(b);false
a.isDisjoint(c);trueIs true when pitch class set is empty.
Returns boolean.
Example
a = FoscPitchSet(#[61,62,63]);
a.isEmpty;false
a = FoscPitchSet([]);
a.isEmpty;trueIs true when receiver is a subset of expr. Otherwise false.
Returns boolean.
Example
a = FoscPitchSet(#[61,62,63]);
b = FoscPitchSet(#[62,63]);
a.isSubsetOf(a);true
a.isSubsetOf(b);false
b.isSubsetOf(a);trueIs true when receiver is a superset of expr. Otherwise false.
Returns boolean.
Example
a = FoscPitchSet(#[61,62,63]);
b = FoscPitchSet(#[62,63]);
a.isSupersetOf(a);true
a.isSupersetOf(b);true
b.isSupersetOf(a);falseIs true when set is not empty.
Returns boolean.
Example
a = FoscPitchSet(#[61,62,63]);
a.notEmpty;true
a = FoscPitchSet([]);
a.notEmpty;falseSymmetric difference of receiver and expr.
Returns new pitch class set.
Example
a = FoscPitchSet(#[61,62,63]);
b = FoscPitchSet(#[62,63,64]);
a.symmetricDifference(b).cs;FoscPitchSet([
FoscPitch('C#4'),
FoscPitch('E4')
])Union of receiver and expr.
Returns new pitch class set.
Example
a = FoscPitchSet(#[61,62,63]);
b = FoscPitchSet(#[62,63,64]);
a.union(b).cs;FoscPitchSet([
FoscPitch('C#4'),
FoscPitch('D4'),
FoscPitch('Eb4'),
FoscPitch('E4')
])Example
a = FoscPitchSet(#[61,62,63]);
b = a.invert(60);
b.cs;FoscPitchSet([
FoscPitch('A3'),
FoscPitch('Bb3'),
FoscPitch('B3')
])True if receiver is equivalent to pitchSet under transposition.
Otherwise false.
Example
a = FoscPitchSet(#[60,61,62]);
b = FoscPitchSet(#[61,62,63]);
c = FoscPitchSet(#[60,61,63]);
a.isEquivalentUnderTransposition(a);true
a.isEquivalentUnderTransposition(b);true
a.isEquivalentUnderTransposition(c);falseRegisters pitchClasses by pitch set.
Returns list of zero or more numbered pitches.
Transposes all pitches in pitch set by semitones.
Returns new pitch set.
Example
a = FoscPitchSet(#[61,62,63]);
b = a.transpose(3);
b.cs;FoscPitchSet([
FoscPitch('E4'),
FoscPitch('F4'),
FoscPitch('F#4')
])