XJ music engine
1.9.6
In-game runtime engine for XJ music.
|
#include <Tuning.h>
Public Member Functions | |
Tuning () | |
Tuning (const Note &rootNote, const float &rootPitch) | |
float | pitch (Note note) |
Note | getTones (float pitch) |
int | deltaFromRootPitch (float pitch) |
float | pitchAtDelta (int delta) const |
void | validate () const |
Static Public Member Functions | |
static Tuning | atA4 (float a4) |
static Tuning | at (Note note, float pitch) |
Public Attributes | |
Note | rootNote |
float | rootPitch |
Provides exact pitch for any Note, in Hz. A Tuning
instance is fixed to a given tuning of note A4, in Hz. Computations for notes at that tuning are cached in memory.
[#255] Note pitch is calculated at 32-bit floating point precision, based on root note configured in environment parameters.
Reference: http://www.phy.mtu.edu/~suits/notefreqs.html
Tuning::Tuning | ( | ) |
Default constructor
Tuning::Tuning | ( | const Note & | rootNote, |
const float & | rootPitch | ||
) |
constructor
|
static |
int Tuning::deltaFromRootPitch | ( | float | pitch | ) |
delta, +/- semitones, from the root pitch to the target pitch
pitch | to get delta of |
Note Tuning::getTones | ( | float | pitch | ) |
Closest Note, for any pitch in Hz
pitch | to get octave of |
float Tuning::pitch | ( | Note | note | ) |
Pitch for any Note, in Hz (caches results by octave and pitch class)
note | to get pitch for |
float Tuning::pitchAtDelta | ( | int | delta | ) | const |
Pitch in Hz, for +/- semitones from known root pitch
delta | +/- semitones from root pitch |
void Tuning::validate | ( | ) | const |
validate after construction
@ if any properties are invalid
Note XJ::Tuning::rootNote |
float XJ::Tuning::rootPitch |