Synth controls

This commit is contained in:
Dejvino
2026-02-27 21:59:14 +01:00
parent 5240eb990b
commit c8bdf3ee13
3 changed files with 182 additions and 29 deletions
+13
View File
@@ -54,12 +54,25 @@ public:
*/
void setWaveform(Waveform form);
/**
* @brief Opens or closes the sound gate.
* @param isOpen True to produce sound, false for silence.
*/
void setGate(bool isOpen);
/**
* @brief Gets the current frequency of the oscillator.
* @return The frequency in Hz.
*/
float getFrequency() const;
private:
uint32_t _sampleRate;
uint32_t _phase; // Phase accumulator for the oscillator.
uint32_t _increment; // Phase increment per sample, determines frequency.
float _volume;
Waveform _waveform;
bool _isGateOpen;
};
#endif // SYNTH_ENGINE_H