MUSX Document Model
Loading...
Searching...
No Matches
music_theory::Pitch Struct Reference

A spelled pitch, expressed relative to C4. More...

#include <music_theory.hpp>

Public Member Functions

constexpr Pitch ()=default
 Creates an unspecified pitch.
 
constexpr Pitch (NoteName pitchName, int pitchOctave, int pitchAlteration=0)
 Creates a spelled pitch.
 

Public Attributes

NoteName noteName {}
 The diatonic note name.
 
int octave {}
 The octave number, where C4 is middle C.
 
int alteration {}
 The alteration relative to the natural note name, in EDO divisions.
 

Detailed Description

A spelled pitch, expressed relative to C4.

The alteration is relative to the natural note name, in EDO divisions. This type does not encode a key signature or scale degree.

Constructor & Destructor Documentation

◆ Pitch()

constexpr music_theory::Pitch::Pitch ( NoteName  pitchName,
int  pitchOctave,
int  pitchAlteration = 0 
)
inlineconstexpr

Creates a spelled pitch.

Parameters
pitchNameThe diatonic note name.
pitchOctaveThe octave number, where C4 is middle C.
pitchAlterationThe alteration relative to the natural note name, in EDO divisions.