Returns a FoscPitchSegment.
Pitch segment
| asCompileString | |
| == | |
| != | |
| storeArgs | |
| str |
| pitches | |
| pitchNumbers | |
| pitchNames | |
| pitchString | |
| invert | Inverts pitch segment about axis. |
| isEquivalentUnderTransposition | True if pitch set is equivalent to expr under transposition. |
| makeNotes | |
| multiply | Multiplies pitch segment. |
| reverse | Retrograde of pitch segment. |
| rotate | Rotates pitch segment. |
| transpose | Transposes pitch segment by expr. |
| hasDuplicates | True if pitch segment has duplicate items. Otherwise false. |
| midicps | (abjad: hertz) |
| inflectionPointCount | Inflection point count of pitch segment. |
| localMaxima | Local maxima of pitch segment. |
| localMinima | Local minima of pitch segment. |
| maxItem | |
| minItem | code:: |
| illustrate | |
| inspect | |
| play | |
| show |
Example
n = [60, 62, 64];
FoscPitchSegment(n).cs;FoscPitchSegment([
FoscPitch('C4'),
FoscPitch('D4'),
FoscPitch('E4')
])Example
n = "Bb4 F#5 C4 Cb4 E+4 G4 D+5";
FoscPitchSegment(n).cs;FoscPitchSegment([
FoscPitch('Bb4'),
FoscPitch('F#5'),
FoscPitch('C4'),
FoscPitch('Cb4'),
FoscPitch('E+4'),
FoscPitch('G4'),
FoscPitch('D+5')
])FoscPitchSegment does not wrap FoscPitchSegments
n = "Bb4 F#5 <C4 Cb4> E+4 G4 D+5";
FoscPitchSegment(n).cs;ERROR: Meta_FoscPitchSegment:new: item a FoscPitchSegment is the wrong type: FoscPitchSegment.Example
FoscPitchSegment([60, 62, 64]).cs;FoscPitchSegment([
FoscPitch('C4'),
FoscPitch('D4'),
FoscPitch('E4')
])Example
FoscPitchSegment([60, 62, 64]).str;<c' d' e'>Inverts pitch segment about axis.
Returns new pitch segment.
Example
a = FoscPitchSegment([60, 61, 62, 63]);
b = a.invert(66);
b.pitchNumbers;[ 72.0, 71.0, 70.0, 69.0 ]
a = FoscPitchSegment([60, 61, 62, 63]);
b = a.invert;
b.pitchNumbers;[ 60.0, 59.0, 58.0, 57.0 ]True if pitch set is equivalent to expr under transposition.
Otherwise false.
Returns true or false.
Example
a = FoscPitchSegment([60, 61, 62]);
b = FoscPitchSegment([61, 62, 63]);
c = FoscPitchSegment([60, 61, 63]);
isEquivalentUnderTransposition(a, b);true
isEquivalentUnderTransposition(a, c);false
isEquivalentUnderTransposition(a, a);trueMultiplies pitch segment.
Returns new pitch segment.
code:: a = FoscPitchSegment([60, 61, 62]); b = a.multiply(3); b.pitchNumbers;
Retrograde of pitch segment.
Returns new pitch segment.
Example
a = FoscPitchSegment([60, 61, 62]);
b = a.retrograde;
b.pitchNumbers;prFormatCodeString interpret initial failed: a DoesNotUnderstandError
a = FoscPitchSegment([60, 61, 62]);
b = a.retrograde;
Rotates pitch segment.
Returns new pitch segment.
Example
a = FoscPitchSegment([60, 61, 62]);
b = a.rotate(-1);
b.pitchNumbers;[ 61.0, 62.0, 60.0 ]
a = FoscPitchSegment([60, 61, 62]);
b = a.rotate(-1, transpose: true);
b.pitchNumbers;[ 60.0, 61.0, 59.0 ]Transposes pitch segment by expr.
Returns new pitch segment.
Example
a = FoscPitchSegment([60, 61, 62]);
b = a.transpose(1);
b.pitchNumbers;[ 61.0, 62.0, 63.0 ]
a = FoscPitchSegment([60, 61, 62]);
b = a.transpose([12, 14, 16]);
b.pitchNumbers;[ 72.0, 75.0, 78.0 ]True if pitch segment has duplicate items. Otherwise false.
Returns true or false.
Example
a = FoscPitchSegment([60, 61, 62]);
a.hasDuplicates;false
a = FoscPitchSegment([60, 60, 61, 62]);
a.hasDuplicates;true(abjad: hertz)
Gets hertz of pitches in pitch segment.
Returns tuple.
Example
a = FoscPitchSegment([60, 61, 62]);
a.midicps;[ 261.6255653006, 277.18263097687, 293.66476791741 ]Inflection point count of pitch segment.
Returns nonnegative integer.
Example
a = FoscPitchSegment([60, 61, 62, 63, 64, 65, 66, 68, 81, 65, 59, 63, 84, 60]);
a.inflectionPointCount;3Local maxima of pitch segment.
Returns array.
code:: a = FoscPitchSegment([60, 61, 62, 63, 64, 65, 66, 68, 81, 65, 59, 63, 84, 60]); a.localMaxima.collect { |each| each.pitchNumber };
Local minima of pitch segment.
Returns array
Example
a = FoscPitchSegment([60, 61, 62, 63, 64, 65, 66, 68, 81, 65, 59, 63, 84, 60]);
a.localMinima.collect { |each| each.pitchNumber };[ 59.0 ]Example
a = FoscPitchSegment([60, 61, 62, 63, 64, 65, 66, 68, 81, 65, 59, 63, 84, 60]);
a.maxItem.pitchNumber;84.0code:: a = FoscPitchSegment([60, 61, 62, 63, 64, 65, 66, 68, 81, 65, 59, 63, 84, 60]); a.minItem.pitchNumber;
Example
a = FoscPitchSegment([60, 61, 62, 63, 64, 65, 66, 68, 81, 65, 59, 63, 84, 60]);
a.illustrate.format;
a.show;
Example
a = FoscPitchSegment([60, 61, 62, 63, 64, 65, 66, 68, 81, 65, 59, 63, 84, 60]);
a.show;