Move the oscillator count to Config.h
This commit is contained in:
parent
0dca7dbc5e
commit
c4c4278ee3
4 changed files with 7 additions and 10 deletions
|
|
@ -60,6 +60,7 @@ namespace config {
|
||||||
constexpr int filtersInPool { maxVoices * 2 };
|
constexpr int filtersInPool { maxVoices * 2 };
|
||||||
constexpr int filtersPerVoice { 2 };
|
constexpr int filtersPerVoice { 2 };
|
||||||
constexpr int eqsPerVoice { 3 };
|
constexpr int eqsPerVoice { 3 };
|
||||||
|
constexpr int oscillatorsPerVoice { 9 };
|
||||||
constexpr float noiseVariance { 0.25f };
|
constexpr float noiseVariance { 0.25f };
|
||||||
/**
|
/**
|
||||||
Minimum interval in frames between recomputations of coefficients of the
|
Minimum interval in frames between recomputations of coefficients of the
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace Default
|
||||||
constexpr float oscillatorPhase { 0.0 };
|
constexpr float oscillatorPhase { 0.0 };
|
||||||
constexpr Range<float> oscillatorPhaseRange { -1.0, 360.0 };
|
constexpr Range<float> oscillatorPhaseRange { -1.0, 360.0 };
|
||||||
constexpr int oscillatorMulti { 1 };
|
constexpr int oscillatorMulti { 1 };
|
||||||
constexpr Range<int> oscillatorMultiRange { 1, 9 };
|
constexpr Range<int> oscillatorMultiRange { 1, config::oscillatorsPerVoice };
|
||||||
constexpr float oscillatorDetune { 0 };
|
constexpr float oscillatorDetune { 0 };
|
||||||
constexpr Range<float> oscillatorDetuneRange { -9600, 9600 };
|
constexpr Range<float> oscillatorDetuneRange { -9600, 9600 };
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -666,7 +666,7 @@ void sfz::Voice::setupOscillatorUnison()
|
||||||
waveUnisonSize = m;
|
waveUnisonSize = m;
|
||||||
|
|
||||||
// detune (cents)
|
// detune (cents)
|
||||||
float detunes[maxWaveOscillators];
|
float detunes[config::oscillatorsPerVoice];
|
||||||
detunes[0] = 0.0;
|
detunes[0] = 0.0;
|
||||||
detunes[1] = -d;
|
detunes[1] = -d;
|
||||||
detunes[2] = +d;
|
detunes[2] = +d;
|
||||||
|
|
@ -703,5 +703,3 @@ void sfz::Voice::setupOscillatorUnison()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr unsigned sfz::Voice::maxWaveOscillators;
|
|
||||||
|
|
|
||||||
|
|
@ -288,15 +288,13 @@ private:
|
||||||
ADSREnvelope<float> egEnvelope;
|
ADSREnvelope<float> egEnvelope;
|
||||||
float bendStepFactor { centsFactor(1) };
|
float bendStepFactor { centsFactor(1) };
|
||||||
|
|
||||||
static constexpr unsigned maxWaveOscillators = Default::oscillatorMultiRange.getEnd();
|
WavetableOscillator waveOscillators[config::oscillatorsPerVoice];
|
||||||
|
|
||||||
WavetableOscillator waveOscillators[maxWaveOscillators];
|
|
||||||
|
|
||||||
// unison of oscillators
|
// unison of oscillators
|
||||||
unsigned waveUnisonSize { 0 };
|
unsigned waveUnisonSize { 0 };
|
||||||
float waveDetuneRatio[maxWaveOscillators] { };
|
float waveDetuneRatio[config::oscillatorsPerVoice] { };
|
||||||
float waveLeftGain[maxWaveOscillators] { };
|
float waveLeftGain[config::oscillatorsPerVoice] { };
|
||||||
float waveRightGain[maxWaveOscillators] { };
|
float waveRightGain[config::oscillatorsPerVoice] { };
|
||||||
|
|
||||||
Duration dataDuration;
|
Duration dataDuration;
|
||||||
Duration amplitudeDuration;
|
Duration amplitudeDuration;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue