Fixed handling of sustain pedal.

pull/1/head
Holger Wirtz 8 years ago
parent 4b89d69db5
commit 4f0a4f607a
  1. 14
      src/dexed.cpp

@ -331,10 +331,9 @@ void Dexed::run (uint32_t sample_count)
Plugin::run(sample_count);
if(++_param_counter>=16)
if(++_param_counter%16)
{
set_params(); // pre_process: copy actual voice params
_param_counter=0;
}
for (LV2_Atom_Event* ev = lv2_atom_sequence_begin (&seq->body);
@ -447,10 +446,11 @@ void Dexed::GetSamples(uint32_t n_samples, float* buffer)
extra_buf_size_ = i - n_samples;
}
if(++_param_counter>=16)
if(++_param_counter%32)
{
for(i=0;i < MAX_ACTIVE_NOTES;i++) {
if(voices[i].live==true && voices[i].keydown==false && voices[i].sustained==false)
for(i=0;i < MAX_ACTIVE_NOTES;i++)
{
if(voices[i].live==true)
{
uint8_t op_amp=0;
uint8_t op_out=controllers.core->op_out(data[134]);
@ -467,12 +467,12 @@ if(++_param_counter>=16)
TRACE("Voice[%2d] OP [%d] amp=%ld,amp_step=%d,pitch_step=%d",i,op,voiceStatus.amp[op],voiceStatus.ampStep[op],voiceStatus.pitchStep);
if(voiceStatus.amp[op]<=1069)
if(voiceStatus.amp[op]<=1069) // this voice produces no audio output
op_amp++;
}
}
if(op_amp==op_carrier_num)
voices[i].live=false;
voices[i].live=false; // every carrier produces no audio anymore
}
// TRACE("Voice[%2d] live=%d keydown=%d",i,voices[i].live,voices[i].keydown);
}

Loading…
Cancel
Save