Skip to content

Commit

Permalink
set Threshold range to [0, 100]
Browse files Browse the repository at this point in the history
Threshold > 100 behaves the same as 100. So why not set range below and
equal 100?

This commit updated UI correspondingly:
- Updated Threshold knob range
- Set Threshold knob step to lower scale for accurate tuning
- Updated help
  • Loading branch information
AnClark committed Feb 12, 2024
1 parent 50a5c11 commit a785d22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions comprez.pd
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#X text 252 333 // arg \$2: ratio;
#X text 252 313 // arg \$1: threshold;
#X text 251 354 // arg \$3: attack/release time (ms);
#X obj 238 31 r Threshold @hv_param 0 200 70;
#X obj 468 87 r Ratio @hv_param 1 100 1;
#X obj 238 31 r Threshold @hv_param 0 100 70;
#X connect 1 0 9 2;
#X connect 2 0 1 0;
#X connect 3 0 7 0;
Expand All @@ -25,5 +25,5 @@
#X connect 8 0 5 0;
#X connect 9 0 0 0;
#X connect 9 1 0 1;
#X connect 13 0 2 0;
#X connect 14 0 3 0;
#X connect 13 0 3 0;
#X connect 14 0 2 0;
8 changes: 4 additions & 4 deletions override/HeavyDPF_Comprez_UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ class ImGuiPluginUI : public UI
constexpr auto RATIO_MAX_VALUE_NARROW = 10.0f;

auto ratiostep = (fratio_range) ? 1.0f : 0.1f;
auto thresholdstep = 1.0f;
auto thresholdstep = 0.1f;
auto msstep = 2.0f;

if (io.KeyShift)
{
ratiostep = (fratio_range) ? 0.1f : 0.01f;
thresholdstep = 0.1f;
thresholdstep = 0.01f;
msstep = 1.0f;
}

Expand Down Expand Up @@ -196,7 +196,7 @@ class ImGuiPluginUI : public UI

ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ThresholdActive);
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ThresholdHovered);
if (ImGuiKnobs::Knob("Threshold", &fthreshold, 0.0f, 200.0f, thresholdstep, "%.1f", ImGuiKnobVariant_SteppedTick, hundred, ImGuiKnob_Flags, 11))
if (ImGuiKnobs::Knob("Threshold", &fthreshold, 0.0f, 100.0f, thresholdstep, "%.1f", ImGuiKnobVariant_SteppedTick, hundred, ImGuiKnob_Flags, 11))
{
if (ImGui::IsItemActivated())
{
Expand Down Expand Up @@ -353,7 +353,7 @@ class ImGuiPluginUI : public UI
ImGui::TextWrapped("Set the start point where to begin compressing.");
ImGui::Dummy(ImVec2(0, 5));

ImGui::Text("[Range]\n 0.0 ~ 200.0");
ImGui::Text("[Range]\n 0.0 ~ 100.0");
ImGui::Text(" Smaller value means lower threshold.");
ImGui::Dummy(ImVec2(0, 3));

Expand Down

0 comments on commit a785d22

Please sign in to comment.