Struct ChromaticInterval
Chromatic interval measured in semitones. Can be negative (descending) or larger than an octave (compound).
public readonly record struct ChromaticInterval : IEquatable<ChromaticInterval>
- Implements
- Inherited Members
Constructors
ChromaticInterval(int)
Chromatic interval measured in semitones. Can be negative (descending) or larger than an octave (compound).
public ChromaticInterval(int Semitones)
Parameters
SemitonesintThe signed semitone size of the interval.
Fields
MajorSecond
Major second (2 semitones).
public static readonly ChromaticInterval MajorSecond
Field Value
MajorSeventh
Major seventh (11 semitones).
public static readonly ChromaticInterval MajorSeventh
Field Value
MajorSixth
Major sixth (9 semitones).
public static readonly ChromaticInterval MajorSixth
Field Value
MajorThird
Major third (4 semitones).
public static readonly ChromaticInterval MajorThird
Field Value
MinorSecond
Minor second (1 semitone).
public static readonly ChromaticInterval MinorSecond
Field Value
MinorSeventh
Minor seventh (10 semitones).
public static readonly ChromaticInterval MinorSeventh
Field Value
MinorSixth
Minor sixth (8 semitones).
public static readonly ChromaticInterval MinorSixth
Field Value
MinorThird
Minor third (3 semitones).
public static readonly ChromaticInterval MinorThird
Field Value
Octave
Octave (12 semitones).
public static readonly ChromaticInterval Octave
Field Value
PerfectFifth
Perfect fifth (7 semitones).
public static readonly ChromaticInterval PerfectFifth
Field Value
PerfectFourth
Perfect fourth (5 semitones).
public static readonly ChromaticInterval PerfectFourth
Field Value
Tritone
Tritone (6 semitones).
public static readonly ChromaticInterval Tritone
Field Value
Unison
Unison (0 semitones).
public static readonly ChromaticInterval Unison
Field Value
Properties
AbsSemitones
Absolute semitone count.
public int AbsSemitones { get; }
Property Value
ClassSemitones
Semitone class in 0..11 (mod 12). Always non-negative. Useful for pitch-class arithmetic.
public int ClassSemitones { get; }
Property Value
Direction
Direction of the interval: -1 descending, 0 unison, +1 ascending.
public int Direction { get; }
Property Value
GenericNumber
Generic interval number (ignores quality): 1=unison, 2=second, ... 8=octave. Tritone is returned as 4 (closest generic class).
public int GenericNumber { get; }
Property Value
Semitones
The signed semitone size of the interval.
public int Semitones { get; init; }
Property Value
SimpleName
Short quality/size name of the simplified interval (e.g. "M3", "P5", "TT").
public string SimpleName { get; }
Property Value
SimpleSemitones
Simple (within octave) semitone size in 0..12. For example: 14 -> 2 (M2), 12 -> 12 (P8).
public int SimpleSemitones { get; }
Property Value
Methods
ToString()
Returns SimpleName.
public override string ToString()
Returns
Operators
operator -(ChromaticInterval)
Negates the interval (reverses its direction).
public static ChromaticInterval operator -(ChromaticInterval i)