3 #ifndef BIRD_SAMPLE_RATE
4 #define BIRD_SAMPLE_RATE 44100
7 struct synth_bird_signature
9 float length
, pause
, /* timings in seconds */
10 x0
,x1
,x2
,x3
, /* polynomial coefficients for the fundemental */
11 v0
,v1
,v2
,v3
; /* volume of each oscillator */
13 int lfo_hz
; /* LFO frequency (30-60hz) */
14 float fm
; /* LFO modulation depth (+/- hz) */
25 int x
, length
, /* position/length of signature in samples */
26 gate
, adsr
, /* adsr ranges 0->44100 */
27 frame
; /* current frame of the pattern */
37 struct synth_bird_settings
{
38 int tones
[4][2]; /* fraction of the fundemental tone
39 for each oscillator */
40 float adsr_rise
, /* rise/fall in seconds */
44 k_bird_lfo_sine_approx
,
45 k_bird_lfo_bipolar_poly
50 struct synth_bird_signature pattern
[];
55 void synth_bird_reset( struct synth_bird
*bird
);
56 u32
synth_bird_get_length_in_samples( struct synth_bird
*bird
);
57 void synth_bird_generate_samples( struct synth_bird
*bird
,
58 float *stereo_buffer
, int samples
);