Fix crash in wavetables changing while playing. Fixed crash enabling noise.

This commit is contained in:
Roland Rabien 2023-09-04 08:27:23 -07:00
commit 59a761fc69
4 changed files with 7 additions and 6 deletions

View file

@ -12,8 +12,8 @@ WavetableVoice::WavetableVoice (WavetableAudioProcessor& p)
void WavetableVoice::noteStarted()
{
oscillators[0].setWavetable (proc.osc1Tables);
oscillators[1].setWavetable (proc.osc2Tables);
oscillators[0].setWavetable (&proc.osc1Tables);
oscillators[1].setWavetable (&proc.osc2Tables);
fastKill = false;
startVoice();
@ -243,7 +243,7 @@ void WavetableVoice::updateParams (int blockSize)
if (proc.noiseParams.enable->isOn())
{
noiseParams.wave = int (getValue (proc.noiseParams.type)) == 0 ? gin::Wave::whiteNoise : gin::Wave::pinkNoise;
noiseParams.wave = proc.noiseParams.type->getUserValueInt() == 0 ? gin::Wave::whiteNoise : gin::Wave::pinkNoise;
noiseParams.leftGain = getValue (proc.noiseParams.level) * (1.0f - getValue (proc.noiseParams.pan));
noiseParams.rightGain = getValue (proc.noiseParams.level) * (1.0f + getValue (proc.noiseParams.pan));