mirror of
https://codeberg.org/armin/wavetable.git
synced 2026-09-01 05:50:46 +02:00
Initial Commit
This commit is contained in:
commit
73110bbde2
20 changed files with 2600 additions and 0 deletions
58
plugin/Source/WavetableVoice.h
Normal file
58
plugin/Source/WavetableVoice.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#pragma once
|
||||
|
||||
#include <JuceHeader.h>
|
||||
#include "Cfg.h"
|
||||
|
||||
class WavetableAudioProcessor;
|
||||
|
||||
//==============================================================================
|
||||
class WavetableVoice : public gin::SynthesiserVoice,
|
||||
public gin::ModVoice
|
||||
{
|
||||
public:
|
||||
WavetableVoice (WavetableAudioProcessor& p, gin::BandLimitedLookupTables& bandLimitedLookupTables);
|
||||
|
||||
void noteStarted() override;
|
||||
void noteRetriggered() override;
|
||||
void noteStopped (bool allowTailOff) override;
|
||||
|
||||
void notePressureChanged() override;
|
||||
void noteTimbreChanged() override;
|
||||
void notePitchbendChanged() override {}
|
||||
void noteKeyStateChanged() override {}
|
||||
|
||||
void setCurrentSampleRate (double newRate) override;
|
||||
|
||||
void renderNextBlock (AudioBuffer<float>& outputBuffer, int startSample, int numSamples) override;
|
||||
|
||||
bool isVoiceActive() override;
|
||||
|
||||
float getFilterCutoffNormalized (int idx);
|
||||
|
||||
private:
|
||||
void updateParams (int blockSize);
|
||||
|
||||
WavetableAudioProcessor& proc;
|
||||
gin::BandLimitedLookupTables& bandLimitedLookupTables;
|
||||
|
||||
gin::VoicedStereoOscillator oscillators[Cfg::numOSCs] =
|
||||
{
|
||||
bandLimitedLookupTables,
|
||||
};
|
||||
|
||||
gin::Filter filters[Cfg::numFilters];
|
||||
gin::ADSR filterADSRs[Cfg::numFilters];
|
||||
|
||||
gin::ADSR modADSRs[Cfg::numENVs];
|
||||
gin::LFO modLFOs[Cfg::numLFOs];
|
||||
gin::StepLFO modStepLFO;
|
||||
|
||||
gin::AnalogADSR adsr;
|
||||
|
||||
float currentMidiNotes[Cfg::numOSCs];
|
||||
gin::VoicedStereoOscillator::Params oscParams[Cfg::numOSCs];
|
||||
|
||||
gin::EasedValueSmoother<float> noteSmoother;
|
||||
|
||||
float ampKeyTrack = 1.0f;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue