Skip to content

Commit

Permalink
Handle F2 Offset Scene Copy and Paste Error (#6487)
Browse files Browse the repository at this point in the history
F2 offset copied properly but didn't update the params correctly
so the slider had the wrong type. This is done as one of several
things and we need to review them, as discussed in #6486 but
until then, lets just do the gross thing to address this one case.

Closes #6475
  • Loading branch information
baconpaul authored Aug 6, 2022
1 parent b317fba commit eeaf676
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/common/SurgeStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,27 @@ void SurgeStorage::clipboard_paste(int type, int scene, int entry, modsources ms
getPatch().param_ptr[pid]->porta_retrigger = p.porta_retrigger;
getPatch().param_ptr[pid]->porta_curve = p.porta_curve;
getPatch().param_ptr[pid]->deform_type = p.deform_type;

/*
* This is a really nasty special case that the bool relative switch
* modifies the cross-param *type* of the filter cutoff when it is setvalue01ed
* This is a gross workaround for the bug in #6475 which I will ponder after pushing.
*/
if (pid == getPatch().scene[scene].f2_cutoff_is_offset.id)
{
auto down = p.val.b;
if (down)
{
getPatch().scene[scene].filterunit[1].cutoff.set_type(ct_freq_mod);
getPatch().scene[scene].filterunit[1].cutoff.set_name("Offset");
}
else
{
getPatch().scene[scene].filterunit[1].cutoff.set_type(
ct_freq_audible_with_tunability);
getPatch().scene[scene].filterunit[1].cutoff.set_name("Cutoff");
}
}
}

if (type & cp_osc)
Expand Down

0 comments on commit eeaf676

Please sign in to comment.