Alias-free oscillators (#5826)

Add a band-limited, alias-free wavetable oscillator option to the
`Oscillator` class. Use it by default for Triple Oscillator.

Savefiles which do not have this feature enabled (e.g. old
savefiles) will be loaded without this feature to keep the sound
consistent.

Original author: @curlymorphic.
Fixed: @he29-net.
This commit is contained in:
Martin Pavelek
2021-07-04 13:14:59 +02:00
committed by GitHub
parent f8d7fa3b87
commit 6f8c6dba82
14 changed files with 580 additions and 75 deletions

View File

@@ -35,6 +35,7 @@
#include "ProjectJournal.h"
#include "Song.h"
#include "BandLimitedWave.h"
#include "Oscillator.h"
float LmmsCore::s_framesPerTick;
Mixer* LmmsCore::s_mixer = NULL;
@@ -58,6 +59,8 @@ void LmmsCore::init( bool renderOnly )
emit engine->initProgress(tr("Generating wavetables"));
// generate (load from file) bandlimited wavetables
BandLimitedWave::generateWaves();
//initilize oscillators
Oscillator::waveTableInit();
emit engine->initProgress(tr("Initializing data structures"));
s_projectJournal = new ProjectJournal;
@@ -111,6 +114,10 @@ void LmmsCore::destroy()
deleteHelper( &s_song );
delete ConfigManager::inst();
// The oscillator FFT plans remain throughout the application lifecycle
// due to being expensive to create, and being used whenever a userwave form is changed
Oscillator::destroyFFTPlans();
}