From 3d95a25600b5cab8a7e5245b7a581bd8c8939276 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 5 Jan 2011 15:47:55 +0100 Subject: Note-compiler is _mostly_ complete; plus some tiny bugfixes The note-compiler can read a program-definition and emits a cpp-file which implements that definition. This implementation is optimized. HOWEVER, the compiler still does not emit a set_param() function. this will lead to a linker error because the function is not implemented (but defined). After adding an empty implementation by hand the emitted compiles well, and also seems to work when used in the synth. TODO: - implement set_param() - compiler must emit a loader-function (which returns a new Note) - use that loader function in the synth --- note_compiler/parser.cpp | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'note_compiler/parser.cpp') diff --git a/note_compiler/parser.cpp b/note_compiler/parser.cpp index 98c65ac..3f142bd 100644 --- a/note_compiler/parser.cpp +++ b/note_compiler/parser.cpp @@ -37,6 +37,8 @@ void init_oscs(int n_osc, oscillator_t *osc) osc[i].vibrato_lfo=0; osc[i].vibrato_lfo_const=true; osc[i].have_custom_wave=false; + osc[i].sync=false; + osc[i].sync_const=true; } } @@ -44,11 +46,12 @@ void init_envs(int n_osc, env_settings_t *env) { for (int i=0;i100)) //TODO FINDMICH besseres kriterium? + env[i].enabled=false; + + if ( ((filter.env_settings.attack==0) && (filter.env_settings.sustain==1.0) + && (filter.env_settings.release>100)) //TODO FINDMICH siehe oben + || ((filter.env_amount==0) && (filter.env_amount_const==true)) ) + filter.env_settings.enabled=false; + + bool use_sync=false; + for (int i=0;i