Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions doc/12_roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

I have a lot of ideas for a '1.2' version of six sines. Not 2.0. Still compatible. But expanded. Here's my rough list

## THings which came in after mostly done

- Reset Controls when automated for clap edge for things like sample rate

## Modulation
- Clamp targets
- LFO -> M etc... depth as an additive and attenuation target
Expand Down
58 changes: 35 additions & 23 deletions src/synth/synth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,26 +698,7 @@ void Synth::processUIQueue(const clap_output_events_t *outq)
dest->value = uiM->value;
}

/*
* Some params have other side effects
*/
if (dest->meta.id == patch.output.playMode.meta.id ||
dest->meta.id == patch.output.polyLimit.meta.id ||
dest->meta.id == patch.output.pianoModeActive.meta.id ||
dest->meta.id == patch.output.mpeActive.meta.id ||
dest->meta.id == patch.output.sampleRateStrategy.meta.id ||
dest->meta.id == patch.output.resampleEngine.meta.id ||
dest->meta.id == patch.output.lowpass.meta.id ||
dest->meta.id == patch.output.highpass.meta.id ||
dest->meta.id == patch.output.bitRateAdjust.meta.id)
{
reapplyControlSettings();
}

if (dest->adhocFeatures & Param::AdHocFeatureValues::SOLO)
{
resetSoloState();
}
handleAudioThreadParamSideEffects(dest);

auto d = patch.dirty;
if (!d)
Expand Down Expand Up @@ -1075,14 +1056,45 @@ void Synth::handleParamValue(Param *p, uint32_t pid, float value)
p = patch.paramMap.at(pid);
}

// p->value = value;
p->lag.setTarget(value);
paramLagSet.addToActive(p);
// Mirror the UI path (SET_PARAM): only FLOATs lag; discrete params snap so
// that handleAudioThreadParamSideEffects sees the new value, not the old.
if (p->meta.type == md_t::FLOAT)
{
p->lag.setTarget(value);
paramLagSet.addToActive(p);
}
else
{
p->value = value;
}

handleAudioThreadParamSideEffects(p);

AudioToUIMsg au = {AudioToUIMsg::UPDATE_PARAM, pid, value};
audioToUi.push(au);
}

void Synth::handleAudioThreadParamSideEffects(Param *dest)
{
if (dest->meta.id == patch.output.playMode.meta.id ||
dest->meta.id == patch.output.polyLimit.meta.id ||
dest->meta.id == patch.output.pianoModeActive.meta.id ||
dest->meta.id == patch.output.mpeActive.meta.id ||
dest->meta.id == patch.output.sampleRateStrategy.meta.id ||
dest->meta.id == patch.output.resampleEngine.meta.id ||
dest->meta.id == patch.output.lowpass.meta.id ||
dest->meta.id == patch.output.highpass.meta.id ||
dest->meta.id == patch.output.bitRateAdjust.meta.id)
{
reapplyControlSettings();
}

if (dest->adhocFeatures & Param::AdHocFeatureValues::SOLO)
{
resetSoloState();
}
}

void Synth::pushFullUIRefresh()
{
for (const auto *p : patch.params)
Expand Down
1 change: 1 addition & 0 deletions src/synth/synth.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ struct Synth

void reapplyControlSettings();
void resetSoloState();
void handleAudioThreadParamSideEffects(Param *dest);

sst::cpputils::active_set_overlay<Param> paramLagSet;

Expand Down
Loading