瀏覽代碼

Fix wavetable crash on instrument change after stop

dds
PaulStoffregen 6 年之前
父節點
當前提交
84073ecbfd
共有 1 個檔案被更改,包括 6 行新增4 行删除
  1. +6
    -4
      synth_wavetable.cpp

+ 6
- 4
synth_wavetable.cpp 查看文件

@@ -77,10 +77,12 @@ CODE_BLOCK_TO_TEST
*/
void AudioSynthWavetable::stop(void) {
cli();
env_state = STATE_RELEASE;
env_count = current_sample->RELEASE_COUNT;
if (env_count == 0) env_count = 1;
env_incr = -(env_mult) / (env_count * ENVELOPE_PERIOD);
if (env_state != STATE_IDLE) {
env_state = STATE_RELEASE;
env_count = current_sample->RELEASE_COUNT;
if (env_count == 0) env_count = 1;
env_incr = -(env_mult) / (env_count * ENVELOPE_PERIOD);
}
PRINT_ENV(STATE_RELEASE);
sei();
}

Loading…
取消
儲存