Files
DrumMachine/synthisizer.h

26 lines
525 B
C
Raw Permalink Normal View History

2020-04-27 22:59:30 +02:00
#pragma once
2022-12-27 10:15:13 +01:00
#include <QObject>
2022-12-27 21:19:21 +01:00
struct frame_t;
2020-04-27 22:59:30 +02:00
class DrumMachineSettings;
2022-12-27 10:15:13 +01:00
class Synthisizer : public QObject
2020-04-27 22:59:30 +02:00
{
public:
2022-12-27 10:15:13 +01:00
float volume() const { return m_volume; }
void setVolume(float volume) { m_volume = volume; }
int16_t frequency() const { return m_frequency; }
2020-04-27 22:59:30 +02:00
void setFrequency(int16_t frequency) { m_frequency = frequency; }
void writeSamples(frame_t *begin, frame_t *end);
private:
2022-12-27 10:15:13 +01:00
float m_volume{1.f};
2020-04-27 22:59:30 +02:00
int16_t m_frequency{};
2020-04-29 19:48:41 +02:00
int16_t m_actualFrequency{};
2020-04-27 22:59:30 +02:00
double m_phase{};
};