| 118 | } |
| 119 | |
| 120 | int PeriodicWave::numberOfPartialsForRange(int rangeIndex) const |
| 121 | { |
| 122 | // Number of cents below nyquist where we cull partials. |
| 123 | float centsToCull = rangeIndex * m_centsPerRange; |
| 124 | |
| 125 | // A value from 0 -> 1 representing what fraction of the partials to keep. |
| 126 | float cullingScale = powf(2, -centsToCull / 1200.f); |
| 127 | |
| 128 | // The very top range will have all the partials culled. |
| 129 | int numberOfPartials = static_cast<int>(cullingScale * maxNumberOfPartials()); |
| 130 | |
| 131 | return numberOfPartials; |
| 132 | } |
| 133 | |
| 134 | // Convert into time-domain wave tables. |
| 135 | // One table is created for each range for non-aliasing playback at different playback rates. |
nothing calls this directly
no outgoing calls
no test coverage detected