Corrected a bug were the silence wavetable was not initalized with 0
This commit is contained in:
parent
c820fbc591
commit
d294d1e3e0
1 changed files with 11 additions and 2 deletions
|
|
@ -253,8 +253,17 @@ WavetableMulti WavetableMulti::createForHarmonicProfile(
|
||||||
const WavetableMulti* WavetableMulti::getSilenceWavetable()
|
const WavetableMulti* WavetableMulti::getSilenceWavetable()
|
||||||
{
|
{
|
||||||
static WavetableMulti wm;
|
static WavetableMulti wm;
|
||||||
wm.allocateStorage(1);
|
static bool initialized { false };
|
||||||
wm.fillExtra();
|
|
||||||
|
if (!initialized) {
|
||||||
|
constexpr unsigned numTables = WavetableMulti::numTables();
|
||||||
|
wm.allocateStorage(1);
|
||||||
|
for (unsigned m = 0; m < numTables; ++m) {
|
||||||
|
float* ptr = const_cast<float*>(wm.getTablePointer(m));
|
||||||
|
*ptr = 0;
|
||||||
|
}
|
||||||
|
wm.fillExtra();
|
||||||
|
}
|
||||||
return &wm;
|
return &wm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue