#define BIRD_SAMPLE_RATE 44100
#endif
-struct synth_bird_signature
-{
+struct synth_bird_signature{
float length, pause, /* timings in seconds */
x0,x1,x2,x3, /* polynomial coefficients for the fundemental */
v0,v1,v2,v3; /* volume of each oscillator */
float fm; /* LFO modulation depth (+/- hz) */
};
-struct synth_bird
-{
- struct
- {
+struct synth_bird{
+ struct{
int osc_main[4],
osc_lfo;
float volume[4];
}
rt;
- struct synth_bird_settings
- {
+ struct synth_bird_settings{
int tones[4][2]; /* fraction of the fundemental tone
for each oscillator */
float adsr_rise, /* rise/fall in seconds */
adsr_fall;
- enum bird_lfo_wave
- {
+ enum bird_lfo_wave{
k_bird_lfo_sine_approx,
k_bird_lfo_bipolar_poly
}
{
u32 total = 0;
- for( int i=0; i<bird->settings.pattern_length; i ++ )
- {
+ for( int i=0; i<bird->settings.pattern_length; i ++ ){
struct synth_bird_signature *sig = &bird->settings.pattern[i];
u32 l = sig->length * (float)BIRD_SAMPLE_RATE,
vg_bin_str( src, txt, synth_bird_save_size( bird ) );
}
+#if 0
static void synth_bird_load( struct synth_bird *bird,
const char *txt, u32 length )
{
return (string_length/2) +
sizeof(struct synth_bird) - sizeof(struct synth_bird_settings);
}
+#endif
#ifdef SYNTH_BIRD_STDLIB
#include "stdlib.h"