summaryrefslogtreecommitdiff
path: root/note_compiler/templates
diff options
context:
space:
mode:
Diffstat (limited to 'note_compiler/templates')
-rw-r--r--note_compiler/templates/head.11
-rw-r--r--note_compiler/templates/interface.13
-rw-r--r--note_compiler/templates/set_param.116
3 files changed, 18 insertions, 2 deletions
diff --git a/note_compiler/templates/head.1 b/note_compiler/templates/head.1
index b50d694..73beec6 100644
--- a/note_compiler/templates/head.1
+++ b/note_compiler/templates/head.1
@@ -13,6 +13,7 @@
using namespace std;
int filter_update_frames=0;
+int envelope_update_frames=0;
int samp_rate=0;
fixed_t** wave=NULL;
fixed_t** curr_lfo=NULL;
diff --git a/note_compiler/templates/interface.1 b/note_compiler/templates/interface.1
index 2ccee41..7a7c58e 100644
--- a/note_compiler/templates/interface.1
+++ b/note_compiler/templates/interface.1
@@ -7,10 +7,11 @@ extern "C" NoteSkel* create_note(int n, float v,program_t &prg, jack_nframes_t p
return new Note(n,v,prg,pf,pb,prg_no,vol_fac);
}
-extern "C" void init_vars(int sr, int fupfr, fixed_t **w, fixed_t **clfo, output_note_func_t* out_n, IntToStr_func_t* its)
+extern "C" void init_vars(int sr, int fupfr, int envupfr, fixed_t **w, fixed_t **clfo, output_note_func_t* out_n, IntToStr_func_t* its)
{
samp_rate=sr;
filter_update_frames=fupfr;
+ envelope_update_frames=envupfr;
wave=w;
curr_lfo=clfo;
IntToStr=its;
diff --git a/note_compiler/templates/set_param.1 b/note_compiler/templates/set_param.1
index 21fc983..e99f481 100644
--- a/note_compiler/templates/set_param.1
+++ b/note_compiler/templates/set_param.1
@@ -5,6 +5,13 @@
return;
}
+ if ( ((p.par==FREQ_ATTACK) || (p.par==FREQ_DECAY) || (p.par==FREQ_SUSTAIN) ||
+ (p.par==FREQ_RELEASE) || (p.par==FREQ_HOLD)) && sel_factor_env==NULL )
+ {
+ output_note("NOTE: cannot change parameter for freq-envelope"+IntToStr(p.osc)+" because it's disabled");
+ return;
+ }
+
switch(p.par)
{
case ATTACK: sel_env->set_attack(v*samp_rate >>SCALE); break;
@@ -13,10 +20,17 @@
case RELEASE: sel_env->set_release(v*samp_rate >>SCALE); break;
case HOLD: sel_env->set_hold(v!=0); break;
+ case FREQ_ATTACK: sel_factor_env->set_attack(v*samp_rate >>SCALE); break;
+ case FREQ_DECAY: sel_factor_env->set_decay(v*samp_rate >>SCALE); break;
+ case FREQ_SUSTAIN: sel_factor_env->set_sustain(v); break;
+ case FREQ_RELEASE: sel_factor_env->set_release(v*samp_rate >>SCALE); break;
+ case FREQ_HOLD: sel_factor_env->set_hold((v!=0)); break;
+ case FREQ_ENV_AMOUNT: sel_orig_osc->freq_env_amount=double(v)/ONE; apply_pfactor(); break;
+
case KSR: sel_osc->ksr=float(v)/ONE; break;
case KSL: sel_osc->ksl=float(v)/ONE; break;
- case FACTOR: sel_osc->factor=v; break;
+ case FACTOR: sel_orig_osc->factor=v; sel_osc->factor=v*freqfactor_factor[p.osc]; break;
case TREMOLO: sel_osc->tremolo_depth=v; break;
case TREM_LFO: sel_osc->tremolo_lfo=v; break;
case VIBRATO: sel_osc->vibrato_depth=v; break;