X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg_audio_synth_bird.h;h=ff6ef50153c1f99a13bf132c624f70fc535a10ad;hb=87adbb9de6b8c68b912179ae00cbd49181c2945a;hp=62c30e672c8a03c17792929e2c2ba38b0fe68b23;hpb=28ec4a17033cc45198adab23ddf66ccd7a230db8;p=vg.git diff --git a/vg_audio_synth_bird.h b/vg_audio_synth_bird.h index 62c30e6..ff6ef50 100644 --- a/vg_audio_synth_bird.h +++ b/vg_audio_synth_bird.h @@ -8,8 +8,7 @@ #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 */ @@ -18,10 +17,8 @@ struct synth_bird_signature float fm; /* LFO modulation depth (+/- hz) */ }; -struct synth_bird -{ - struct - { +struct synth_bird{ + struct{ int osc_main[4], osc_lfo; float volume[4]; @@ -39,15 +36,13 @@ struct synth_bird } 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 } @@ -209,8 +204,7 @@ static u32 synth_bird_get_length_in_samples( struct synth_bird *bird ) { u32 total = 0; - for( int i=0; isettings.pattern_length; i ++ ) - { + for( int i=0; isettings.pattern_length; i ++ ){ struct synth_bird_signature *sig = &bird->settings.pattern[i]; u32 l = sig->length * (float)BIRD_SAMPLE_RATE, @@ -260,6 +254,7 @@ static void synth_bird_save( struct synth_bird *bird, void *txt ) 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 ) { @@ -273,6 +268,7 @@ static u32 synth_bird_memory_requirement( u32 string_length ) return (string_length/2) + sizeof(struct synth_bird) - sizeof(struct synth_bird_settings); } +#endif #ifdef SYNTH_BIRD_STDLIB #include "stdlib.h"