From 8320af55e716f352f2720801fcd73913f2e7d19c Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sat, 8 Jan 2011 19:35:27 +0100 Subject: Envelope::get_level() gets called rarely now Also, changed .gitignore to ignore gmon.out --- synth/note.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'synth/note.cpp') diff --git a/synth/note.cpp b/synth/note.cpp index 86e4b2b..8479153 100644 --- a/synth/note.cpp +++ b/synth/note.cpp @@ -1,3 +1,5 @@ +#define ENV_NTH_FRAME 50 + #include #include "note.h" @@ -30,16 +32,17 @@ Note::Note(int n, float v, program_t &prg, jack_nframes_t pf, fixed_t pb, int pr for (int i=0;i=ENV_NTH_FRAME) + { + env_frame_counter=0; + for (i=0;iget_level(); + } + + for (i=0;iwave[ ((oscillator[i].phase + fm) * cw->samp_rate >>(2*SCALE)) % cw->wave_len ] * envelope[i]->get_level() >> (SCALE); + oscval[i]=cw->wave[ ((oscillator[i].phase + fm) * cw->samp_rate >>(2*SCALE)) % cw->wave_len ] * envval[i] >> (SCALE); } else { //normal oscillator - oscval[i]=wave[oscillator[i].waveform][ ((oscillator[i].phase + fm) * WAVE_RES >>SCALE) % WAVE_RES ] * envelope[i]->get_level() >> (SCALE); + oscval[i]=wave[oscillator[i].waveform][ ((oscillator[i].phase + fm) * WAVE_RES >>SCALE) % WAVE_RES ] * envval[i] >> (SCALE); } if (oscillator[i].tremolo_depth!=0) -- cgit v1.2.3