MCPcopy Create free account
hub / github.com/LabSound/LabSound / numberOfPartialsForRange

Method numberOfPartialsForRange

src/core/PeriodicWave.cpp:120–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120int 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected