1 #ifndef SYNTH_H 2 #define SYNTH_H 3 4 struct Adsr 5 { AdsrAdsr6 Adsr(void) :at(0.05),dt(0.05),rt(0.05), av(-1.0), dv(1.0), sv(0.0), rv(-1.0) {} 7 float time; 8 float relval; 9 bool pgate; 10 11 float at,dt, rt; 12 float av,dv,sv,rv; 13 14 float operator()(bool gate); 15 static struct rtosc::Ports ports; 16 }; 17 18 struct Synth { 19 Adsr amp_env, frq_env; 20 float freq; 21 bool gate; 22 23 float sample(void); 24 static struct rtosc::Ports ports; 25 }; 26 #endif 27