Optimize more by avoiding floating point

This commit is contained in:
Dejvino
2026-03-01 14:26:18 +01:00
parent 8cc8898c01
commit 534a7512c4
3 changed files with 32 additions and 27 deletions
+2
View File
@@ -107,6 +107,7 @@ public:
float value = 0.0f; // Current output sample
float next_value = 0.0f; // For double-buffering in processGridStep
float phase = 0.0f; // For Oscillator, Noise state
uint32_t phase_accumulator = 0; // For Oscillators (Fixed point optimization)
};
static const int GRID_W = 12;
@@ -131,6 +132,7 @@ private:
uint32_t _increment; // Phase increment per sample, determines frequency.
float _volume;
Waveform _waveform;
float _freqToPhaseInc; // Pre-calculated constant for frequency to phase increment conversion
bool _isGateOpen;
uint32_t _rngState;
std::vector<std::pair<int, int>> _processing_order;