-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstate.hpp
More file actions
55 lines (40 loc) · 874 Bytes
/
state.hpp
File metadata and controls
55 lines (40 loc) · 874 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
/*
* File: noisy.hpp
*
* Enveloped noise generator
*
*/
#include "userosc.h"
class LfoTargetFlags
{
public:
typedef enum : int32_t
{
None = 0,
Volume = 1,
NoiseMod = 2
} enum_type;
LfoTargetFlags(enum_type targets = None) : value(targets) { }
operator enum_type() const { return value; }
bool operator&(int32_t operand) { return static_cast<int32_t>(value) & operand; }
private:
enum_type value;
};
struct State
{
public:
float currentLevel;
float lfoLevel;
int32_t attackResistance;
int32_t decayResistance;
float sustainLevel;
int32_t releaseFactor;
int32_t releaseResistance;
bool noteDown;
bool attackPhaseComplete;
int32_t noiseType;
int32_t modValue;
int32_t lfoTarget; // bitfield of LfoTargetFlags
int32_t envToModPercentage;
};