MusicTheory Docs API Toolbox GitHub NuGet
Contents

API / MusicTheory

Temperament class

A tuning system: per-degree offsets (in cents) from 12-TET, applied relative to a tonic.
The model is a 12-key keyboard instrument, so enharmonic notes share a frequency. In quarter-comma meantone the wolf fifth falls between G# and Eb (relative to the tonic).

Properties

string Name { get; }
The temperament's display name.
static Temperament Equal { get; }
Twelve-tone equal temperament: every offset is zero.
static Temperament Pythagorean { get; }
Pythagorean tuning: a chain of pure fifths.
static Temperament JustIntonation { get; }
5-limit just intonation (9/5 minor seventh, 45/32 tritone).
static Temperament QuarterCommaMeantone { get; }
Quarter-comma meantone: pure major thirds, fifths narrowed by a quarter syntonic comma.

Methods

bool Equals(object? obj)
Two temperaments are equal when they are the same tuning system (the constructor is private, so the name identifies it).
double GetFrequency(Note note, Note tonic, double a4 = 440)
The frequency of note in this temperament, keeping A sounding at a4.
note
The note to sound; only its pitch class and octave matter.
tonic
The key's tonic; its octave is ignored.
a4
The frequency of A4 in hertz.

Throws ArgumentNullException note or tonic is null.

int GetHashCode()
double OffsetCents(int semitonesAboveTonic)
Offset in cents from 12-TET of the degree semitonesAboveTonic (0..11).

Throws ArgumentOutOfRangeException The degree is outside 0..11.

string ToString()