76 |
} |
} |
77 |
|
|
78 |
/** |
/** |
79 |
|
* Slower version of CentsToFreqRatio, for big values. |
80 |
|
* |
81 |
|
* @param cents - pitch value in cents (+1200 cents means +1 octave) |
82 |
|
* @returns frequency ratio (e.g. +2.0 for +1 octave) |
83 |
|
*/ |
84 |
|
static double CentsToFreqRatioUnlimited(double Cents) { |
85 |
|
int octaves = int(Cents / 1200); |
86 |
|
double x = CentsToFreqRatio(Cents - octaves * 1200); |
87 |
|
return octaves < 0 ? x / (1 << -octaves) : x * (1 << octaves); |
88 |
|
} |
89 |
|
|
90 |
|
/** |
91 |
* Inverse function to CentsToFreqRatio(). This function is a bit |
* Inverse function to CentsToFreqRatio(). This function is a bit |
92 |
* slow, so it should not be called too frequently. |
* slow, so it should not be called too frequently. |
93 |
*/ |
*/ |