-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtubeamp.h
51 lines (43 loc) · 789 Bytes
/
tubeamp.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
#ifndef TUBEAMP_H_
#define TUBEAMP_H_
#include <stdbool.h>
typedef struct Batch
{
struct Batch *next;
int length;
double *data;
double bounds;
} BATCH;
typedef struct CircuitState
{
double U;
double W[2];
double X[2];
double Y;
} CIRCUITSTATE;
typedef struct TubeConfig
{
double Mu;
double K_p;
double K_vb;
double K_g;
double Ex;
double V_lambda;
double R_gk;
double K;
double baseline;
bool simulateGridCurrent;
} TUBECONFIG;
typedef enum TubeName
{
_12AX7,
CUSTOM,
} TUBENAME;
CIRCUITSTATE *
process_buffer(BATCH *batch, TUBECONFIG *config,
CIRCUITSTATE *state, int sample_rate, int buffer_length, double input_gain);
TUBECONFIG *
set_config(TUBENAME tube_name, TUBECONFIG *config, bool grid_current);
BATCH *
rescale(BATCH *batch, double factor);
#endif