-
Notifications
You must be signed in to change notification settings - Fork 0
/
osc.h
66 lines (55 loc) · 1.5 KB
/
osc.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
class Osc {
private:
double x = 0;
//double volume = 0.5;
//double rest = 0.528;
//double length = 12.95;
//double width = 2.1;
//double thickness = 0.11;
//double clearance = 0.05;
//double min = 0.5;
//double max = 1.3;
//double volume = 1;
//double rest = 0.1;
//double length = 1;
//double width = 1;
//double thickness = 0.05;
//double clearance = 0.05;
//double max = 1.09;
//double min = 0.88;
double volume = 0.5;
double rest = 0.3;
double length = 1;
double width = 1;
double thickness = 0.05;
double clearance = 0.05;
double min = 0.0;
double max = 1.3;
//double volume = 0.5;
//double rest = 0.2;
//double length = 1;
//double width = 1;
//double thickness = 0.05;
//double clearance = 0.05;
//double min = 0.0;
//double max = 1.2;
// high pass filter
double alpha = 0.9; // high pass
double last = 0;
double high_pass = 0;
double env = 0;
double env_smooth = 2000; // bad filter lol
double epsilon = 0.0001;
bool running = false;
public:
double rate = 0;
double freq = 0;
double amp = 0;
double pan = 0;
bool on = false;
double run ();
void start ();
void stop ();
bool is_on ();
};