16 #define ASSERT(cond)    assertion(cond, #cond) 
   20 #define _STEP  1.0594630943592953 
   21 #define _STEP2  (_STEP * _STEP) 
   22 #define _STEP4  (_STEP2 * _STEP2) 
   24 #define _A  (440.0 * 2 * VCO_MAX_VALUE / (4 * SAMPLING_RATE)) 
   26 #define F(oct)       ((int) ((1 << oct) * _A / _STEP4)) 
   27 #define Fsharp(oct)  ((int) ((1 << oct) * _A / _STEP2 / _STEP)) 
   28 #define G(oct)       ((int) ((1 << oct) * _A / _STEP2)) 
   29 #define Gsharp(oct)  ((int) ((1 << oct) * _A / _STEP)) 
   30 #define A(oct)       ((int) ((1 << oct) * _A)) 
   31 #define Bflat(oct)   ((int) ((1 << oct) * _A * _STEP)) 
   32 #define B(oct)       ((int) ((1 << oct) * _A * _STEP2)) 
   33 #define C(oct)       ((int) ((1 << oct) * _A * _STEP2 * _STEP)) 
   38         fprintf(stderr, 
"ASSERTION FAILED: %s\n", strcond);
 
   51     gp_outf = fopen(
"foo.gp", 
"w");
 
   53     outf = fopen(
"foo.py", 
"w");
 
   55     fprintf(outf, 
"samples = [\n");
 
   66         fprintf(gp_outf, 
"%d %d %d\n", t, 
v[0].
adsr.output() >> 23, (int) (y - 2048));
 
   69         fprintf(outf, 
"%ld,\n", (
long int) (y << 5));
 
   71         if (t == SAMPLING_RATE / 2) {
 
   75         if (t == SAMPLING_RATE) {
 
void compute_sample(void)
uint8_t read(uint32_t *x)
void assertion(int cond, const char *strcond)