summaryrefslogtreecommitdiff
path: root/synth/note.h
diff options
context:
space:
mode:
authorFlorian Jung <florian.a.jung@web.de>2012-04-12 22:35:44 +0200
committerFlorian Jung <florian.a.jung@web.de>2012-04-12 22:35:44 +0200
commit2f796b659626569c02dd5016dc3df45000e2b7e2 (patch)
treee014eec75fdf0e0b19041a471c29b39303a18de3 /synth/note.h
parent7c875a14b73d844f4f3b8390e4463610262d9415 (diff)
use precalculated phase_increment instead of calculating it every
frame: brings up to 33% speed boost! bugfix: ksr now uses dest_freq instead of (current) freq
Diffstat (limited to 'synth/note.h')
-rw-r--r--synth/note.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/synth/note.h b/synth/note.h
index 379f2b1..3b8311e 100644
--- a/synth/note.h
+++ b/synth/note.h
@@ -24,6 +24,8 @@ class Note : public NoteSkel
bool still_active();
void set_param(const parameter_t &p, fixed_t v);
+ void recalc_actual_freq();
+
void destroy();
private:
@@ -32,6 +34,8 @@ class Note : public NoteSkel
void recalc_factors();
void apply_pfactor();
+
+ void recalc_oscillator_phase_increment(int osc);
Envelope **envelope;
@@ -45,10 +49,14 @@ class Note : public NoteSkel
fixed_t *old_oscval;
int n_oscillators;
oscillator_t *oscillator;
+ fixed_t* oscillator_phase_increment;
std::list<int>* fm_oscs;
fixed_t sync_factor;
fixed_t sync_phase;
+ fixed_t sync_phase_increment;
+
+ fixed_t actual_freq;
pfactor_value_t pfactor;