-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
104 lines (72 loc) · 1.77 KB
/
main.cpp
File metadata and controls
104 lines (72 loc) · 1.77 KB
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
#include "lib/pa.h"
#include "soundlib.h"
#include "soundlib_sig.h"
#include "soundlib_ctl.h"
#include "expr.h"
void paFunc(const float* in, float* out, unsigned long frames, void* data){
Sig* o = (Sig*)data;
for(unsigned long i = 0; i < frames; i++){
call_sig();
*out++ = o->output*0.7;
}
}
int main(){
sl_init();
Mult out;
// Osc mod(434);
// Osc car;
// Mult m(2000);
// mod.connect(&m);
// int fundamental = 100;
// Sum s(fundamental);
// m.connect(&s);
// s.connect(&car);
// // adding lfo
// FnGen lfo(sl::saw, 1);
// Sum s2(1); // need expr
// lfo.connect(&s2); // need expr
// Mult amp(2000);
// s2.connect(&);
// // replace default at right inlet
// amp.connect(&m, 1);
// Lp filt(300);
// // add filter and cutoff lfo
// FnGen filtlfo(sl::sin, 6);
// Sum s3(1.5); // need expressions....
// filtlfo.connect(&s3); //
// Mult mm(1000); //
// s3.connect(&mm); //
// mm.connect(&filt, 1);
// car.connect(&filt);
// filt.connect(&out);
Osc mod(434);
Osc car;
FnGen lfo(sl::sin, 1);
FnGen lfo2(sl::saw, 0.18);
Expr expr("f0* (1+f1) * f3*2000 + (1+f2)*120");
mod.connect(&expr);
lfo.connect(&expr, 1);
lfo2.connect(&expr, 2);
expr.connect(&car);
car.connect(&out);
Mouse m;
Mult mm(20);
sig_connect(&m.x, &mm);
mm.connect(&lfo);
sig_connect(&m.y, &expr, 3);
lfo2.disconnect(&expr, 2);
out.setVal(0.6);
// voice patch test
// PolyKey p(1);
// TestVoice v;
// p.connect(&v);
// v.connect(&out);
Pa a(paFunc, &out);
a.start();
while(1){
call_ctl();
// usleep(20);
}
a.terminate();
return 0;
}