From 918f4c99f37b9ca2ae2bbd6c906b7e0f994af014 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/envelope.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'synth/envelope.h') diff --git a/synth/envelope.h b/synth/envelope.h index e0d3502..65ea723 100644 --- a/synth/envelope.h +++ b/synth/envelope.h @@ -6,12 +6,16 @@ #include "programs.h" #include "fixed.h" +// when frames is given, this tells the envelope that get_level() is +// only called every (frames) frames. 1 means "every time", 2 means +// "every second time" and so on. +// the caller must manage to call get_level() to the appropriate times class Envelope { public: - Envelope(jack_nframes_t a, jack_nframes_t d, fixed_t s, jack_nframes_t r, bool h); - Envelope(env_settings_t s); + Envelope(jack_nframes_t a, jack_nframes_t d, fixed_t s, jack_nframes_t r, bool h, int frames=1); + Envelope(env_settings_t s, int frames=1); void release_key(); void reattack(); fixed_t get_level(); @@ -52,6 +56,8 @@ class Envelope jack_nframes_t t; fixed_t ratefactor; + int nth_frame; + enum { ATTACK, -- cgit v1.2.3