diff --git a/WSTD_MANGLR.png b/WSTD_MANGLR.png index 495a91b..85f1d27 100644 Binary files a/WSTD_MANGLR.png and b/WSTD_MANGLR.png differ diff --git a/dep/wstd.cmpnnts b/dep/wstd.cmpnnts index a335ab7..0f9a72b 160000 --- a/dep/wstd.cmpnnts +++ b/dep/wstd.cmpnnts @@ -1 +1 @@ -Subproject commit a335ab7a07d2788baa5efdb274761e01fbd37132 +Subproject commit 0f9a72bf4f147641c640a3665f616daffb045a38 diff --git a/override/HeavyDPF_WSTD_MANGLR_UI.cpp b/override/HeavyDPF_WSTD_MANGLR_UI.cpp index e7b1507..b19b3cf 100644 --- a/override/HeavyDPF_WSTD_MANGLR_UI.cpp +++ b/override/HeavyDPF_WSTD_MANGLR_UI.cpp @@ -10,10 +10,21 @@ START_NAMESPACE_DISTRHO // -------------------------------------------------------------------------------------------------------------------- +enum HeavyParams { + CRSHR, + FLDR, + GAIN, + LMTR, + MIX, + SMTHR, + SQNC, +}; + class ImGuiPluginUI : public UI { int fcrshr = 512; float ffldr = 1.0f; + float fgain = 0.0f; bool flmtr = 1.0f != 0.0f; float fmix = 50.0f; float fsmthr = 1.0f; @@ -62,22 +73,25 @@ class ImGuiPluginUI : public UI void parameterChanged(uint32_t index, float value) override { switch (index) { - case 0: + case CRSHR: fcrshr = value; break; - case 1: + case FLDR: ffldr = value; break; - case 2: + case GAIN: + fgain = value; + break; + case LMTR: flmtr = value != 0.0f; break; - case 3: + case MIX: fmix = value; break; - case 4: + case SMTHR: fsmthr = value; break; - case 5: + case SQNC: fsqnc = value; break; @@ -104,11 +118,11 @@ class ImGuiPluginUI : public UI { if (ImGui::IsItemActivated()) { - editParameter(0, true); + editParameter(CRSHR, true); if (ImGui::IsMouseDoubleClicked(0)) fcrshr = 512; } - setParameterValue(0, fcrshr); + setParameterValue(CRSHR, fcrshr); } ImGui::PopStyleColor(2); ImGui::SameLine(); @@ -128,11 +142,11 @@ class ImGuiPluginUI : public UI { if (ImGui::IsItemActivated()) { - editParameter(1, true); + editParameter(FLDR, true); if (ImGui::IsMouseDoubleClicked(0)) ffldr = 1.0f; } - setParameterValue(1, ffldr); + setParameterValue(FLDR, ffldr); } ImGui::PopStyleColor(2); ImGui::SameLine(); @@ -152,11 +166,11 @@ class ImGuiPluginUI : public UI { if (ImGui::IsItemActivated()) { - editParameter(4, true); + editParameter(SMTHR, true); if (ImGui::IsMouseDoubleClicked(0)) fsmthr = 1.0f; } - setParameterValue(4, fsmthr); + setParameterValue(SMTHR, fsmthr); } ImGui::SameLine(); } @@ -186,13 +200,15 @@ class ImGuiPluginUI : public UI ImFont* titleBarFont = io.Fonts->Fonts[2]; ImFont* mediumFont = io.Fonts->Fonts[3]; - auto intense = 20.0f / 5.0f; + auto intense = (20.0f + (4.0f * fgain)) / 5.0f; auto SyncSw = ColorBright(WhiteDr, intense); auto SyncGr = ColorBright(Grey, intense); auto SyncGrHovered = ColorBright(GreyBr, intense); auto SyncAct = ColorBright(GreenDr, intense); auto SyncActHovered = ColorBright(Green, intense); + auto GainActive = ColorBright(Green, intense); + auto GainHovered = ColorBright(GreenBr, intense); auto MixActive = ColorMix(Green, Yellow, intense, fmix); auto MixHovered = ColorMix(GreenBr, YellowBr, intense, fmix); @@ -203,12 +219,14 @@ class ImGuiPluginUI : public UI auto crshstep = 8; auto elevstep = 0.1f; auto percstep = 1.0f; + auto dbstep = 0.1f; if (io.KeyShift) { crshstep = 1; elevstep = 0.01f; percstep = 0.1f; + dbstep = 0.01f; } const char* sqnc_list[6] = { @@ -249,8 +267,8 @@ class ImGuiPluginUI : public UI if (ImGui::Selectable(sqnc_list[n], is_selected)) { fsqnc = n; - editParameter(5, true); - setParameterValue(5, fsqnc); + editParameter(SQNC, true); + setParameterValue(SQNC, fsqnc); } if (is_selected) ImGui::SetItemDefaultFocus(); @@ -340,8 +358,8 @@ class ImGuiPluginUI : public UI { if (ImGui::IsItemActivated()) { - editParameter(2, true); - setParameterValue(2, flmtr); + editParameter(LMTR, true); + setParameterValue(LMTR, flmtr); } } ImGui::PopStyleColor(5); @@ -349,6 +367,26 @@ class ImGuiPluginUI : public UI ImGui::EndGroup(); ImGui::SameLine(); + ImGui::BeginGroup(); + { + ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)GainActive); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)GainHovered); + if (ImGuiKnobs::Knob( + "Gain", &fgain, -20.0f, 0.0f, dbstep, "%.2fdB", ImGuiKnobVariant_SteppedTick, hundred, ImGuiKnob_Flags, 5)) + { + if (ImGui::IsItemActivated()) + { + editParameter(GAIN, true); + if (ImGui::IsMouseDoubleClicked(0)) + fgain = 0.0f; + } + setParameterValue(GAIN, fgain); + } + ImGui::PopStyleColor(2); + } + ImGui::EndGroup(); + ImGui::SameLine(); + ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)MixActive); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)MixHovered); if (ImGuiKnobs::Knob( @@ -356,11 +394,11 @@ class ImGuiPluginUI : public UI { if (ImGui::IsItemActivated()) { - editParameter(3, true); + editParameter(MIX, true); if (ImGui::IsMouseDoubleClicked(0)) fmix = 50.0f; } - setParameterValue(3, fmix); + setParameterValue(MIX, fmix); } ImGui::PopStyleColor(2); } @@ -368,12 +406,13 @@ class ImGuiPluginUI : public UI if (ImGui::IsItemDeactivated()) { - editParameter(0, false); - editParameter(1, false); - editParameter(2, false); - editParameter(3, false); - editParameter(4, false); - editParameter(5, false); + editParameter(CRSHR, false); + editParameter(FLDR, false); + editParameter(GAIN, false); + editParameter(LMTR, false); + editParameter(MIX, false); + editParameter(SMTHR, false); + editParameter(SQNC, false); } } ImGui::End(); diff --git a/wstd_manglr.json b/wstd_manglr.json index 75007ff..f381eaf 100644 --- a/wstd_manglr.json +++ b/wstd_manglr.json @@ -7,7 +7,7 @@ ], "enable_ui": true, "ui_size": { - "width": 606, + "width": 707, "height": 191 }, "midi_input": 0, @@ -22,7 +22,7 @@ "S~F~C" ] }, - "version": "1, 0, 2", + "version": "1, 1, 0", "license": "GPL-3.0-or-later", "homepage": "https://wasted.audio/software/wstd_manglr", "plugin_uri": "https://wasted.audio/software/wstd_manglr", diff --git a/wstd_manglr.pd b/wstd_manglr.pd index e3628b4..5692cb3 100644 --- a/wstd_manglr.pd +++ b/wstd_manglr.pd @@ -34,17 +34,17 @@ #X restore 441 750 pd mix; #X msg 441 823 \$1 100; #X obj 441 843 line~; -#X obj 853 279 vsl 17 128 0 1 0 0 empty empty empty 0 -9 0 10 #191919 #ffffff #ffffff 0 1; -#X obj 848 428 s \$0-mix; +#X obj 963 352 vsl 17 128 0 1 0 0 empty empty empty 0 -9 0 10 #191919 #ffffff #ffffff 0 1; +#X obj 958 501 s \$0-mix; #X obj 238 167 adc~; #X msg 358 279 sqnc \$1; #X obj 358 219 r Sqnc @hv_param 0 5 0 int; -#X obj 848 219 r Mix @hv_param 0 100 50; +#X obj 958 292 r Mix @hv_param 0 100 50; #X obj 522 369 hsl 128 16 1 11 0 0 empty empty empty -2 -8 0 10 #191919 #ffffff #ffffff 0 1; #X obj 444 313 hsl 128 16 2 512 1 0 empty empty STEPS -2 -6 0 12 #7c7c7c #fcfcfc #808080 0 1; #X obj 591 432 hsl 128 16 1 11 1 1 empty empty empty -2 -6 0 12 #ffffff #202020 #808080 0 1; #X msg 441 343 crshr \$1; -#X obj 848 248 / 100; +#X obj 958 321 / 100; #X obj 519 968 *~; #X obj 519 1086 +~; #X obj 589 1043 *~; @@ -65,7 +65,7 @@ #X msg 58 479 lmtr \$1; #X msg 441 139 512; #X msg 519 139 1; -#X msg 658 139 50; +#X msg 958 245 50; #X obj 441 49 bng 25 250 50 0 empty empty empty 17 7 0 10 #191919 #ffffff #ffffff; #X obj 19 390 loadbang; #X msg 19 419 1; @@ -74,6 +74,10 @@ #X obj 848 79 declare -path dep; #X obj 238 533 wstd.cmpnnts/manglr L; #X obj 328 563 wstd.cmpnnts/manglr R; +#X obj 771 356 vsl 17 128 -20 0 0 0 empty empty empty 0 -9 0 10 #191919 #ffffff #ffffff 0 1; +#X msg 766 501 gain \$1; +#X msg 770 261 0; +#X obj 767 307 r Gain @hv_param -20 0 0; #X connect 0 0 15 0; #X connect 2 0 3 0; #X connect 3 0 1 0; @@ -127,9 +131,15 @@ #X connect 44 0 41 0; #X connect 44 0 42 0; #X connect 44 0 43 0; +#X connect 44 0 54 0; #X connect 45 0 46 0; #X connect 46 0 39 0; #X connect 47 0 18 0; #X connect 48 0 20 0; #X connect 50 0 27 0; #X connect 51 0 29 0; +#X connect 52 0 53 0; +#X connect 53 0 50 1; +#X connect 53 0 51 1; +#X connect 54 0 52 0; +#X connect 55 0 52 0;