Skip to content

Commit

Permalink
Remove VoiceStart as an envelope defaultable mode
Browse files Browse the repository at this point in the history
Closes #42
  • Loading branch information
baconpaul committed Jan 1, 2025
1 parent 7b7be39 commit 49caf78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 8 additions & 0 deletions src/synth/patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ float Patch::migrateParamValueFromVersion(Param *p, float value, uint32_t versio
return 1;
}

if (p == &output.defaultTrigger && version == 6)
{
if (value == 1 /* that's NEW_VOICE */)
{
return 0; /* that's NEW_GATE */
}
}

if ((p->adhocFeatures & (uint64_t)Param::AdHocFeatureValues::TRIGGERMODE))
{
if (version == 5)
Expand Down
2 changes: 1 addition & 1 deletion src/synth/patch.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct Param

struct Patch
{
static constexpr uint32_t patchVersion{6};
static constexpr uint32_t patchVersion{7};
std::vector<const Param *> params;
std::unordered_map<uint32_t, Param *> paramMap;

Expand Down
6 changes: 1 addition & 5 deletions src/ui/playmode-sub-panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ void PlayModeSubPanel::setTriggerButtonLabel()
auto v = (int)std::round(editor.patchCopy.output.defaultTrigger.value);
switch (v)
{
case NEW_VOICE:
triggerButton->setLabel("On Start");
break;
case KEY_PRESS:
triggerButton->setLabel("On Key");
break;
Expand Down Expand Up @@ -265,8 +262,7 @@ void PlayModeSubPanel::showTriggerButtonMenu()
auto p = juce::PopupMenu();
p.addSectionHeader("Default Trigger Mode");
p.addSeparator();
for (int g :
{(int)TriggerMode::KEY_PRESS, (int)TriggerMode::NEW_GATE, (int)TriggerMode::NEW_VOICE})
for (int g : {(int)TriggerMode::KEY_PRESS, (int)TriggerMode::NEW_GATE})
{
p.addItem(TriggerModeName[g], true, tmv == g, genSet(g));
}
Expand Down

0 comments on commit 49caf78

Please sign in to comment.