-
Notifications
You must be signed in to change notification settings - Fork 0
/
dsp_def.h
135 lines (123 loc) · 3.01 KB
/
dsp_def.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#define DEF_8BIT_PLUS 127
#define DEF_8BIT_MINUS 128
#define DEF_16BIT_MAX 32767
#define DEF_16BIT_MIN -32768
#define DEF_8BIT_MAX 127
#define DEF_8BIT_MIN -127
#define DEF_WIN_HAN 0
#define DEF_WIN_HAM 1
#define DEF_WIN_BLACK 2
#define PI 3.14159265358979323846
#define TRUE 1
#define FALSE 0
#define DEF_TUNE_A4 440.0
typedef char STRING[256];
typedef char INT8;
typedef short INT16;
typedef struct{
int nCh;
int nBit;
int nSamBuff; //Internal Purpose(Number of Samples in Input Buffer)
int nSamplePerSec; //e.g : 1s Buffer + nSamBuff + offset
int nDelay;
int in_idx; //Internal Purpose
int out_idx; //Internal Purpose
float *pBuffer;
float WetGain;
float DryGain;
float MixDryGain;
float *TabGain;
int nTabs;
int *TabDelaySams;
bool isProc; //Internal Purpose
}DELAYDATA;
typedef struct{
int nCh;
int nBit;
int nSamplePerSec;
DELAYDATA Buffer[2]; //Internal Purpose
float Fader[2]; //Internal Purpose
float Delay[2]; //Internal Purpose
float Shift[2]; //Internal Purpose
float Vol[2]; //Internal Purpose
bool isProc;
}PITCHSHIFT;
typedef struct{
int nCh;
int nBit;
int nSamplePerSec;
DELAYDATA Buffer;
unsigned long lfotick; //LFO Ticks
float depth; //Vibrato Depth in Samples
float rate; //Vibrato Rate in Hz
float lfoloc; //DO NOT ACCESS rate, depth DIRECTLY!!!!!
bool lfosw;
bool isProc;
}VIBRATO;
typedef struct{
int nCh;
int nBit;
int nSamplePerSec;
DELAYDATA Buffer;
int BufferLen;
int Count;
int Seg;
float CurrentPitch;
float power;
float NoiseTHR;
bool isProc;
}ACPITCH;
typedef struct{
int nCh;
int nBit;
int nSamplePerSec;
DELAYDATA Buffer;
float *pWindow;
int BufferLen;
int Count;
int Seg;
float CurrentPitch;
float power;
bool isProc;
}HPSPITCH;
typedef struct{
int nCh;
int nBit;
int nSamplePerSec;
int FilterLen[2]; //0 : Pole, 1 : Zero
float *ZeroCoeff;
float *PoleCoeff;
float *ZeroBuffer[2]; //0 : Ch1, 1 : Ch2
float *PoleBuffer[2]; //0 : Ch1, 1 : Ch2
float gain;
bool isProc;
}FILTER;
typedef struct{
int nCh;
int nBit;
int nSamplePerSec;
DELAYDATA AllPass[2];
DELAYDATA Comb[2];
float ComGain[2];
float DryGain; //0.0 - 1.0
float WetGain; //0.0 - 1.0
float DecaySec;
float Diffuse; //0.0 - 0.5
float PreGain; //0.0 - 0.5
bool isProc;
}PRCREVERB;
typedef struct{
int nCh;
int nBit;
int nSamplePerSec;
DELAYDATA AllPass[3];
DELAYDATA Comb[4];
DELAYDATA Out[2];
float ComGain[4];
float DryGain; //0.0 - 1.0
float WetGain; //0.0 - 1.0
float DecaySec;
float Diffuse; //0.0 - 0.5
float PreGain; //0.0 - 0.5
bool isProc;
}JCREVERB;