wavetable/plugin/Source/WavetableVoice.h

65 lines
1.8 KiB
C
Raw Normal View History

2020-05-20 16:44:46 -07:00
#pragma once
#include <JuceHeader.h>
#include "Cfg.h"
2024-10-11 17:55:15 -07:00
#include "MTS-ESP/Client/libMTSClient.h"
2020-05-20 16:44:46 -07:00
class WavetableAudioProcessor;
//==============================================================================
class WavetableVoice : public gin::SynthesiserVoice,
2023-08-23 08:45:23 -07:00
public gin::ModVoice
2020-05-20 16:44:46 -07:00
{
public:
2023-08-23 11:21:37 -07:00
WavetableVoice (WavetableAudioProcessor& p);
2023-08-23 08:45:23 -07:00
2024-10-11 17:55:15 -07:00
~WavetableVoice() override;
2020-05-20 16:44:46 -07:00
void noteStarted() override;
void noteRetriggered() override;
void noteStopped (bool allowTailOff) override;
void notePressureChanged() override;
void noteTimbreChanged() override;
2023-09-29 09:01:29 -07:00
void notePitchbendChanged() override;
2020-05-20 16:44:46 -07:00
void noteKeyStateChanged() override {}
2024-06-28 09:59:49 -07:00
float getCurrentNote() override;
2020-05-20 16:44:46 -07:00
void setCurrentSampleRate (double newRate) override;
2023-08-23 08:45:23 -07:00
void renderNextBlock (juce::AudioBuffer<float>& outputBuffer, int startSample, int numSamples) override;
2020-05-20 16:44:46 -07:00
bool isVoiceActive() override;
2023-08-23 11:21:37 -07:00
float getFilterCutoffNormalized();
2023-08-25 08:24:15 -07:00
gin::WTOscillator::Params getLiveWTParams (int osc);
2020-05-20 16:44:46 -07:00
void updateParams (int blockSize);
WavetableAudioProcessor& proc;
2023-08-23 11:21:37 -07:00
gin::WTVoicedStereoOscillator oscillators[Cfg::numOSCs];
2023-08-26 11:17:03 -07:00
gin::StereoOscillator noise;
gin::StereoOscillator sub;
2020-05-20 16:44:46 -07:00
2023-08-23 11:21:37 -07:00
gin::Filter filter;
gin::ADSR filterADSR;
2020-05-20 16:44:46 -07:00
gin::ADSR modADSRs[Cfg::numENVs];
gin::LFO modLFOs[Cfg::numLFOs];
gin::StepLFO modStepLFO;
gin::AnalogADSR adsr;
2023-08-23 08:45:23 -07:00
float currentMidiNotes[Cfg::numOSCs];
2023-08-31 11:17:49 -07:00
gin::WTVoicedStereoOscillatorParams oscParams[Cfg::numOSCs];
2023-08-26 11:17:03 -07:00
float subNote = 0.0f;
gin::StereoOscillator::Params subParams;
gin::StereoOscillator::Params noiseParams;
2020-05-20 16:44:46 -07:00
gin::EasedValueSmoother<float> noteSmoother;
2024-10-11 21:02:25 -07:00
float ampKeyTrack = 1.0f;
2020-05-20 16:44:46 -07:00
};