Pitch class final

A note in the octave range.


See also:

Inheritance
Implemented types
Annotations
  • @immutable

Constructors

Pitch(Note note, {required int octave})
Creates a new Pitch from note and octave.
const
Pitch.parse(String source)
Parse source as a Pitch and return its value.
factory

Properties

augmentedTriad Chord<Pitch>
The ChordPattern.augmentedTriad on this Pitch.
no setter
diminishedTriad Chord<Pitch>
The ChordPattern.diminishedTriad on this Pitch.
no setter
hashCode int
The hash code for this object.
no setteroverride
majorTriad Chord<Pitch>
The ChordPattern.majorTriad on this Pitch.
no setter
midiNumber int?
The MIDI number (an integer from 0 to 127) of this Pitch, or null for pitches out of the MIDI range.
no setter
minorTriad Chord<Pitch>
The ChordPattern.minorTriad on this Pitch.
no setter
note Note
The note inside the octave.
final
octave int
The octave where the note is positioned.
final
respelledDownwards Pitch
This Pitch respelled downwards while keeping the same number of semitones.
no setter
respelledSimple Pitch
This Pitch with the simplest Accidental spelling while keeping the same number of semitones.
no setter
respelledUpwards Pitch
This Pitch respelled upwards while keeping the same number of semitones.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semitones int
The number of semitones of this Pitch from C0 (root).
no setter

Methods

compareTo(Pitch other) int
Compares this object to another object.
override
difference(Pitch other) int
The difference in semitones between this Pitch and other.
override
frequency({Frequency referenceFrequency = const Frequency(440), TuningSystem tuningSystem = const EqualTemperament.edo12()}) Frequency
The Frequency of this Pitch from referenceFrequency and tuningSystem.
harmonics({required int upToIndex, Frequency referenceFrequency = const Frequency(440), TuningSystem tuningSystem = const EqualTemperament.edo12()}) Set<ClosestPitch>
The ClosestPitch set of harmonics series upToIndex from this Pitch.
interval(Pitch other) Interval
The interval between this Pitch and other.
override
isEnharmonicWith(ClassMixin<PitchClass> other) bool
Whether Class is enharmonically equivalent to other.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
respellByAccidental(Accidental accidental) Pitch?
This Pitch respelled by accidental while keeping the same number of semitones.
respellByBaseNote(BaseNote baseNote) Pitch
This Pitch respelled by baseNote while keeping the same number of semitones.
respellByBaseNoteDistance(int distance) Pitch
This Pitch respelled by BaseNote.ordinal distance while keeping the same number of semitones.
toClass() PitchClass
Creates a new PitchClass from semitones.
inherited
toString({PitchNotation system = PitchNotation.scientific}) String
The string representation of this Pitch based on system.
override
transposeBy(Interval interval) Pitch
Transposes this Pitch by interval.
override

Operators

operator +(Cent cents) ClosestPitch
Adds cents to this Pitch, creating a new ClosestPitch.
operator -(Cent cents) ClosestPitch
Subtracts cents from this Pitch, creating a new ClosestPitch.
operator <(Pitch other) bool
Whether this Pitch is lower than other.
operator <=(Pitch other) bool
Whether this Pitch is lower than or equal to other.
operator ==(Object other) bool
The equality operator.
override
operator >(Pitch other) bool
Whether this Pitch is higher than other.
operator >=(Pitch other) bool
Whether this Pitch is higher than or equal to other.

Static Methods

octaveFromSemitones(int semitones) int
The octave that corresponds to the semitones from root height.