-
Notifications
You must be signed in to change notification settings - Fork 0
/
SynthMode.h
35 lines (31 loc) · 977 Bytes
/
SynthMode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include "SynthType.h"
class SynthMode
{
public:
SynthType type() const;
float volumeFrom() const;
float volumeTo() const;
float pitch() const;
bool isDutySet() const;
float duty() const;
void setType(const SynthType& a_type);
void setVolumeFrom(float a_volume);
void setVolumeTo(float a_volume);
void setPitch(float a_pitch);
void setDuty(float a_duty);
private:
static constexpr float MinVolume = 0.0f;
static constexpr float MaxVolume = 1.0f;
static constexpr float MinPitch = -10.0f;
static constexpr float MaxPitch = +10.0f;
static constexpr float DefaultPitch = 0.0f;
static constexpr float MinDuty = 0.01f;
static constexpr float MaxDuty = 1.0f-MinDuty;
static constexpr float WrongDuty = MinDuty-1.0f;
SynthType m_type = SynthType::Sin;
float m_volume_from = MaxVolume;
float m_volume_to = MaxVolume;
float m_pitch = DefaultPitch;
float m_duty = WrongDuty;
};