MCC
Loading...
Searching...
No Matches
MCC::Tuning Class Reference

Tuning reference: a written pitch and its frequency in hertz. More...

#include <Tuning.h>

Collaboration diagram for MCC::Tuning:
Collaboration graph

Public Member Functions

constexpr Tuning () noexcept
 Creates the invalid tuning (SPEC-ERR-2).
constexpr Tuning (MCC::Pitch reference, float frequency) noexcept
 Creates a tuning where reference sounds at frequency Hz. An invalid pitch, or a frequency that is zero, negative, infinite or NaN, produces the invalid tuning (SPEC-ERR-3).
constexpr bool IsValid () const noexcept
 Returns true unless this is the invalid tuning.
constexpr MCC::Pitch Reference () const noexcept
 Returns the reference pitch; invalid for the invalid tuning.
constexpr float ReferenceFrequency () const noexcept
 Returns the reference frequency in hertz, or 0 for the invalid tuning (SPEC-ERR-7).

Static Public Member Functions

static constexpr Tuning Standard () noexcept
 Returns the standard tuning, A4 = 440 Hz (SPEC-OCT-2).
static constexpr Tuning Invalid () noexcept
 Returns the invalid tuning.

Friends

constexpr bool operator== (Tuning a, Tuning b) noexcept
 Equality of reference pitch and frequency. All invalid tunings are equal (SPEC-ERR-6).
constexpr bool operator!= (Tuning a, Tuning b) noexcept

Detailed Description

Tuning reference: a written pitch and its frequency in hertz.

Tuning::Standard() is A4 = 440 Hz (SPEC-OCT-2). Default construction, an invalid reference pitch or a frequency that is not a finite positive number produce the single invalid value (SPEC-ERR-2, SPEC-ERR-3).


The documentation for this class was generated from the following file: