Synth controls
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user