summaryrefslogtreecommitdiff
path: root/synth/programs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'synth/programs.cpp')
-rw-r--r--synth/programs.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/synth/programs.cpp b/synth/programs.cpp
index cfbd9a1..0f675d6 100644
--- a/synth/programs.cpp
+++ b/synth/programs.cpp
@@ -51,6 +51,7 @@ program_t::program_t()
pfactor.fm=NULL;
pfactor.out=NULL;
+ pfactor.freq_env_amount=NULL;
create_func=NULL;
dl_handle=NULL;
@@ -74,6 +75,8 @@ void program_t::cleanup()
if (pfactor.out)
delete [] pfactor.out;
+ if (pfactor.freq_env_amount)
+ delete [] pfactor.freq_env_amount;
if (pfactor.fm)
{
for (unsigned int i=0;i<n_osc;i++)
@@ -119,6 +122,9 @@ program_t& program_t::operator=(const program_t &that)
this->pfactor.out=new param_factor_t [n_osc];
memcpy(this->pfactor.out, that.pfactor.out, sizeof(param_factor_t)*n_osc);
+ this->pfactor.freq_env_amount=new param_factor_t [n_osc];
+ memcpy(this->pfactor.freq_env_amount, that.pfactor.freq_env_amount, sizeof(param_factor_t)*n_osc);
+
this->pfactor.fm=new param_factor_t* [n_osc];
for (i=0;i<n_osc;i++)
{
@@ -227,6 +233,7 @@ void init_default_program(program_t &p)
p.pfactor.out=new param_factor_t [1];
+ p.pfactor.freq_env_amount=new param_factor_t [1];
p.pfactor.fm=new param_factor_t* [1];
p.pfactor.filter_env.offset=ONE;
@@ -239,6 +246,9 @@ void init_default_program(program_t &p)
p.pfactor.out[0].offset=0;
p.pfactor.out[0].vel_amount=ONE;
+
+ p.pfactor.freq_env_amount[0].offset=ONE;
+ p.pfactor.freq_env_amount[0].vel_amount=0;
p.pfactor.fm[0]=new param_factor_t [1];
p.pfactor.fm[0][0].offset=ONE;