maiacore 1.10.1
Music analisys library
config.h File Reference

Global configuration for maiacore tuning system selection. More...

Go to the source code of this file.

Enumerations

enum class  TuningSystem {
  EQUAL_TEMPERAMENT , JUST_INTONATION , PYTHAGOREAN_TUNING , MEANTONE_TEMPERAMENT ,
  WELL_TEMPERAMENT
}
 Enumeration of supported tuning systems for pitch-to-frequency conversion. More...
 

Functions

TuningSystem getTuningSystem ()
 Returns the currently active tuning system for pitch-frequency calculations. More...
 
void setTuningSystem (TuningSystem tuningSystem)
 

Detailed Description

Global configuration for maiacore tuning system selection.

Provides runtime configuration of pitch-to-frequency conversion models for historical performance practice research, microtonal analysis, and period-appropriate acoustical studies. The tuning system affects all frequency-dependent operations throughout the library.

Default configuration: Equal Temperament (12-TET, modern standard tuning).

Enumeration Type Documentation

◆ TuningSystem

enum class TuningSystem
strong

Enumeration of supported tuning systems for pitch-to-frequency conversion.

Different tuning systems alter the frequency ratios between pitches, directly impacting psychoacoustic dissonance calculations, spectral content analysis, and harmonic perception studies. Selection of tuning system is critical for:

  • Historical musicology (Renaissance, Baroque, Classical period works)
  • Microtonal composition and analysis
  • Cross-cultural music research (non-Western tuning practices)
  • Acoustical modeling of period instruments

The active tuning system affects Note::getFrequency() and all derived spectral operations.

Enumerator
EQUAL_TEMPERAMENT 

12-tone equal temperament (12-TET), modern standard tuning.

Each semitone is exactly 2^(1/12) ≈ 1.05946 frequency ratio. All intervals are equally tempered, enabling free modulation to all keys with identical interval quality. Standard for contemporary Western music since the late 19th century. Pitch reference: A4 = 440 Hz (configurable).

JUST_INTONATION 

Just intonation using pure integer frequency ratios.

Intervals are derived from simple integer ratios (3:2 perfect fifth, 5:4 major third, 4:3 perfect fourth, etc.), producing maximum consonance for tonal harmony but limiting modulation due to comma accumulation. Historically used in vocal music, a cappella ensembles, and theoretical tuning studies. Particularly relevant for Renaissance polyphony and harmonic overtone analysis.

PYTHAGOREAN_TUNING 

Pythagorean tuning based on stacked perfect fifths (3:2 ratio).

Generates the diatonic scale by iterating pure 3:2 fifths, producing bright major thirds (81:64 ≈ 408 cents, sharper than equal temperament's 400 cents) and narrow minor thirds. Favors melodic purity and linear counterpoint over harmonic consonance. Dominant tuning system in Medieval and early Renaissance music. The Pythagorean comma (≈24 cents) limits enharmonic equivalence.

MEANTONE_TEMPERAMENT 

Quarter-comma meantone temperament, standard Renaissance/Baroque tuning.

Tempers perfect fifths narrow by 1/4 syntonic comma to achieve pure major thirds (5:4 ratio). Produces excellent triadic consonance in commonly used keys (up to 2-3 sharps/flats) but increasingly dissonant intervals ("wolf tones") in remote keys. Widely used from 1500-1700 for keyboard instruments, fretted strings, and fixed-pitch ensembles. Essential for authentic performance practice of Baroque repertoire.

WELL_TEMPERAMENT 

Well temperament (Werckmeister, Kirnberger, Vallotti variants).

Irregular temperament system with variable key colors—different keys possess distinct harmonic characters due to asymmetric interval distribution. Allows modulation to all 24 major/minor keys while preserving tonal affect differences. Widely used in Baroque and early Classical periods (1680-1810). Bach's "Well-Tempered Clavier" exploits these tonal color variations. Implementation typically follows Werckmeister III tuning.

Function Documentation

◆ getTuningSystem()

TuningSystem getTuningSystem ( )

Returns the currently active tuning system for pitch-frequency calculations.

Returns
Current TuningSystem enumeration value.

The tuning system is a global configuration parameter that persists throughout program execution unless explicitly changed. Default value is EQUAL_TEMPERAMENT.

Examples
C:/Users/nyck/Desktop/maialib/maiacore/include/maiacore/config.h.