Pitch class
Represents the musical pitch of a note.
A pitch is fully described by its diatonic step ("C"–"B"),
octave number, and optional chromatic alter value. Microtonal
alterations are supported through fractional alter values and the
accidentalType field.
Example:
const Pitch(step: 'F', octave: 4, alter: 1.0) // F-sharp 4
Pitch.withAccidental(step: 'B', octave: 3, accidentalType: AccidentalType.flat) // B-flat 3
Pitch.fromString('C#5') // C-sharp 5
- Available extensions
Constructors
- Pitch({required String step, required int octave, double alter = 0.0, AccidentalType? accidentalType, String? customAccidentalGlyph})
-
const
- Pitch.fromSolmization(String syllable, {required int octave, double alter = 0.0, AccidentalType? accidentalType})
-
Constrói um Pitch a partir de nome de solmização em dó fixo.
syllablepode ser 'do', 're', 'mi', 'fa', 'sol', 'la', 'si' (ou 'ti').octaveé o número da oitava;alteré a alteração cromática.factory - Pitch.fromString(String notation)
-
Constrói um Pitch a partir de uma string (ex: "C4", "F#5", "Bb3")
factory
- Pitch.withAccidental({required String step, required int octave, required AccidentalType accidentalType})
-
Construtor com tipo de acidente específico
factory
Properties
- accidentalGlyph → String?
-
Retorna o nome do glifo SMuFL para o acidente
no setter
- accidentalType → AccidentalType?
-
Tipo específico de acidente (opcional, para notações especiais)
final
- alter → double
-
Alteração cromática: -2.0 = dobrado bemol, -1.0 = bemol, 0.0 = natural,
+1.0 = sustenido, +2.0 = dobrado sustenido.
Suporte para microtons com valores decimais.
final
- centsDeviation → double
-
Retorna o intervalo em cents da nota temperada mais próxima
no setter
- customAccidentalGlyph → String?
-
Para acidentes personalizados
final
- frequency → double
-
Calcula a frequência em Hz (A4 = 440Hz)
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- hasMicrotone → bool
-
Verifica se a nota tem microtom
no setter
- midiNumber → int
-
Calcula o número MIDI da nota (C4 = 60).
Para microtons, retorna o valor mais próximo.
no setter
- octave → int
-
A oitava (normalmente 4 é a oitava central).
final
- pitchClass → int
-
Retorna a classe de altura (pitch class) como inteiro 0–11, conforme
o atributo
pclassdo MEI v5. C=0, C#=1, D=2, ..., B=11.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- solmizationName → String
-
Retorna o nome de solmização desta nota em dó fixo (do, re, mi, fa, sol, la, si).
Equivalente ao sistema de solmização do MEI v5.
no setter
- step → String
-
A letra da nota (C, D, E, F, G, A, B).
final
Methods
-
getLedgerLinePositions(
Clef clef) → List< int> -
Available on Pitch, provided by the PitchStaffPosition extension
Obtém linhas suplementares necessárias -
needsLedgerLines(
Clef clef) → bool -
Available on Pitch, provided by the PitchStaffPosition extension
Verifica se precisa de linhas suplementares -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
staffPosition(
Clef clef) → int -
Available on Pitch, provided by the PitchStaffPosition extension
Calcula posição na pauta para uma clave -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override