3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 Christian Schoenebeck * |
* Copyright (C) 2005, 2006 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
75 |
return pCentsToFreqTable[index_int] + index_fract * (pCentsToFreqTable[index_int+1] - pCentsToFreqTable[index_int]); |
return pCentsToFreqTable[index_int] + index_fract * (pCentsToFreqTable[index_int+1] - pCentsToFreqTable[index_int]); |
76 |
} |
} |
77 |
|
|
78 |
|
/** |
79 |
|
* Inverse function to CentsToFreqRatio(). This function is a bit |
80 |
|
* slow, so it should not be called too frequently. |
81 |
|
*/ |
82 |
|
static double FreqRatioToCents(double FreqRatio) { |
83 |
|
return log(FreqRatio) / log(TWELVEHUNDREDTH_ROOT_OF_TWO); |
84 |
|
} |
85 |
|
|
86 |
private: |
private: |
87 |
static float CentsToFreqTable[CONFIG_MAX_PITCH * 1200 * 2 + 1]; |
static float CentsToFreqTable[CONFIG_MAX_PITCH * 1200 * 2 + 1]; |
88 |
static float* pCentsToFreqTable; |
static float* pCentsToFreqTable; |