Skip to content

Commit

Permalink
Clamp Max Porta time to 16 seconds (#7317)
Browse files Browse the repository at this point in the history
Max porta time was 2 (aka "4 seconds") but was modulatable across
the entire range up to about 128 seconds I think. That's the same
as stuck. So add an internal clamp which means even in extreme off
the end modulation, you cap out at 16 seconds.

Addresses case 2 of #7301
  • Loading branch information
baconpaul committed Nov 20, 2023
1 parent 44975d6 commit e7cdc3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/common/dsp/SurgeVoice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,12 @@ void SurgeVoice::update_portamento()
((1.f / quantStep) * fabs(state.getPitch(storage) - state.portasrc_key) + 0.00001));
}

float portaClamp = 4;
// more than 16 second portamento with the modulation is painful. See #7301
assert(scene->portamento.val_max.f < portaClamp);
state.portaphase +=
storage->envelope_rate_linear(localcopy[scene->portamento.param_id_in_scene].f) *
storage->envelope_rate_linear(
std::min(localcopy[scene->portamento.param_id_in_scene].f, portaClamp)) *
(scene->portamento.temposync ? storage->temposyncratio : 1.f) * const_rate_factor;

if ((state.portaphase < 1) &&
Expand Down

0 comments on commit e7cdc3f

Please sign in to comment.