Returns a FoscPitch.
Pitch
| == | (abjad: eq) |
| != | |
| > | Is true when arg can be coerced to a pitch and when this pitch is greater than arg. Otherwise false. |
| >= | Is true when arg can be coerced to a pitch and when this pitch is greater than or equal to arg. Otherwise false. |
| < | Is true when arg can be coerced to a pitch and when this pitch is less than arg. Otherwise false. |
| <= | Is true when arg can be coerced to a pitch and when this pitch is less than or equal to arg. Otherwise false. |
| add | (abjad: add) |
| asCompileString | |
| asFloat | (abjad: float) |
| asInteger | (abjad: int) |
| neg | Negates numbered pitch. |
| storeArgs | |
| str | (abjad: str) |
| pitchString | |
| sub |
| applyAccidental | |
| multiply | Multiplies pitch-class of numbered pitch by n and maintains octave. |
| invert | |
| respellWithFlats | |
| respellWithSharps | code:: |
| toStaffPosition | Changes named pitch to staff position. |
| transpose |
| show | |
| play | |
| inspect |
Quantize to 1/8th tones
a = FoscPitch(60.25);
a.pitchNumber;60.25
a.str;cr'
a = FoscPitch(60.75);
a.pitchNumber;60.75
a.str;csl'Example
a = FoscPitch("C4", arrow: 'up');
a.pitchNumber;60.25
a.str;cr'
a = FoscPitch("C#4", arrow: 'down');
a.pitchNumber;60.75
a.str;csl'Example
FoscPitch('Db5').accidentalName;fExample
FoscPitch('Db5', arrow: 'up').accidentalName;frExample
FoscPitch('Db5').alterationInSemitones;-1.0Example
FoscPitch('Db5', arrow: 'down').alterationInSemitones;-1.25Example
FoscPitch('Db5').diatonicPitchClassName;DExample
FoscPitch('Db5').diatonicPitchClassNumber;2Example
FoscPitch('Db5').diatonicPitchName;D5Example
FoscPitch('Db5').diatonicPitchNumber;74Example
FoscPitch('Db5').isDiatonic;falseExample
FoscPitch('Db5').isFlattened;falseExample
FoscPitch('Db5').isSharpened;falseExample
FoscPitch('Db5').lilypondPitchName;df''Example
FoscPitch('Db5', arrow: 'up').lilypondPitchName;dfr''Example
FoscPitch('A4').midicps;440.0Example
FoscPitch('Db5').octaveName;5Example
FoscPitch('Db5').octaveNumber;5Example
FoscPitch('Db5').pitchClassName;DbExample
FoscPitch('Db5').pitchClassNumber;1.0Example
FoscPitch('Db5', arrow: 'up').pitchClassNumber;1.0Example
FoscPitch('Db5').pitchName;Db5Example
FoscPitch('Db~5').pitchNumber;72.5
FoscPitch(61.5).pitchNumber;61.5
FoscPitch('C4', arrow: 'up').pitchNumber;60.25(abjad: eq)
Example
a = FoscPitch('C#4');
b = FoscPitch('Db4');
c = FoscPitch('B3');
a == a;true
a == b; // Enharmonic equivalents are treated as equaltrue
a == c;falseExample
a = FoscPitch('C#4');
b = FoscPitch('Db4');
c = FoscPitch('B3');
a != b; // Enharmonic equivalents are treated as equalfalse
a != c;true
a != a;falseIs true when arg can be coerced to a pitch and when this pitch is greater than arg. Otherwise false.
Returns true or false.
Example
a = FoscPitch('C#4');
b = FoscPitch('D#4');
c = FoscPitch('B3');
a > b;false
a > c;true
a > a;falseIs true when arg can be coerced to a pitch and when this pitch is greater than or equal to arg. Otherwise false.
Returns true or false.
Example
a = FoscPitch('C#4');
b = FoscPitch('D#4');
c = FoscPitch('B3');
a >= a;true
a >= b;false
a >= c;trueIs true when arg can be coerced to a pitch and when this pitch is less than arg. Otherwise false.
Returns true or false.
Example
a = FoscPitch('C#4');
b = FoscPitch('D#4');
c = FoscPitch('B3');
a < b;true
a < c;false
a < a;falseIs true when arg can be coerced to a pitch and when this pitch is less than or equal to arg. Otherwise false.
Returns true or false.
Example
a = FoscPitch('C#4');
b = FoscPitch('D#4');
c = FoscPitch('B3');
a <= a;true
a <= b;true
a <= c;false(abjad: add)
Adds arg to numberd pitch.
Returns new numbered pitch.
Example
x = FoscPitch('C#4');
x = x + 2;
x.pitchName;Eb4
x = FoscPitch('C#4') + FoscInterval(2);
x.pitchName;Eb4(abjad: float)
Changes numbered pitch to float.
Returns float.
Example
x = FoscPitch('C+4');
x.asFloat;60.5(abjad: int)
Changes numbered pitch to integer.
Returns integer.
Example
x = FoscPitch('C+4');
x.asInt;60Negates numbered pitch.
Returns new numbered pitch.
Example
a = FoscPitch('C#4');
b = a.neg;
b.pitchNumber;-61.0(abjad: str)
Example
a = FoscPitch('C#4');
a.str;cs'•••••••••••••••••••• TODO
a = FoscPitch('C#4', arrow: 'up');
a.str;csr'Example
a = FoscPitch('C#4');
a.pitchString;
a.ps;"C#4"Multiplies pitch-class of numbered pitch by n and maintains octave.
Returns new numbered pitch.
Example
a = FoscPitch(62);
a = a.multiply(3);
a.pitchNumber;66.0Example
x = FoscPitch('Eb4');
x = x.invert(axis: 'D4');
x.pitchName;C#4Example
x = FoscPitch('C#4');
x.pitchName;
x = x.respellWithFlats;
x.pitchName;Db4code:: x = FoscPitch(Db4); x.pitchName; x = x.respellWithSharps; x.pitchName;
• respellWithSharps
x = FoscPitch('Db4');
x.pitchName;
x = x.respellWithSharps;
x.pitchName;C#4Changes named pitch to staff position.
Example
x = FoscPitch('A4');
x = x.transpose(semitones: 6);
x.pitchName;Eb5Example
FoscPitch("C#5").inspect;FoscPitch('C#5')