rem: length_in_seconds(first_stage_length_rep + second_stage_length_rep); curpos = 0.0;
add: if (samples_per_second() > 0) { set_length_in_seconds(first_stage_length_rep + second_stage_length_rep); } else { set_length_in_samples(0); } set_position_in_samples(0);
context: void TWO_STAGE_LINEAR_ENVELOPE::set_parameter(int param, CONTROLLER_SOURCE::parameter_type value) {  switch (param) {  case 1:    {      first_stage_length_rep = value;      length_in_seconds(first_stage_length_rep + second_stage_length_rep);      curpos = 0.0;      curval = 0.0;      break;    }  case 2:    {      second_stage_length_rep = value;      length_in_seconds(first_stage_length_rep + second_stage_length_rep);      curpos = 0.0;      curval = 0.0;      break;    }  }}