Skip to content

Commit

Permalink
Transverb: visually dim "feedback" sliders when "freeze" mode is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiapoirier committed Feb 20, 2022
1 parent b91c146 commit a723925
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/transverb.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1 class="title">Transverb</h1>
</p>

<p class="desc">
<b>Freeze</b> will pause recording new audio into the delay buffer, leading the delays to keep reusing the same audio that existed when you enabled freeze mode.
<b>Freeze</b> will pause recording new audio into the delay buffer, leading the delays to keep reusing the same audio that existed when you enabled freeze mode. (Consequently, <b>feedback</b> has no effect during freeze mode.)
</p>

<br />
Expand Down Expand Up @@ -117,7 +117,7 @@ <h1 class="title">Transverb</h1>
<br />
<a href="http:https://destroyfx.org">http:https://destroyfx.org</a>
<br /><br />
Transverb is Copyright &copy; 2001-2021 Tom Murphy 7 and Sophia Poirier
Transverb is Copyright &copy; 2001-2022 Tom Murphy 7 and Sophia Poirier
<br />
<br />
This software comes with absolutely no warranty, express or implied.
Expand Down
4 changes: 2 additions & 2 deletions site/docs/transverb.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1 class="title">Transverb</h1>
</p>

<p class="desc">
<b>Freeze</b> will pause recording new audio into the delay buffer, leading the delays to keep reusing the same audio that existed when you enabled freeze mode.
<b>Freeze</b> will pause recording new audio into the delay buffer, leading the delays to keep reusing the same audio that existed when you enabled freeze mode. (Consequently, <b>feedback</b> has no effect during freeze mode.)
</p>

<br />
Expand Down Expand Up @@ -117,7 +117,7 @@ <h1 class="title">Transverb</h1>
<br />
<a href="http:https://destroyfx.org">http:https://destroyfx.org</a>
<br /><br />
Transverb is Copyright &copy; 2001-2021 Tom Murphy 7 and Sophia Poirier
Transverb is Copyright &copy; 2001-2022 Tom Murphy 7 and Sophia Poirier
<br />
<br />
This software comes with absolutely no warranty, express or implied.
Expand Down
24 changes: 20 additions & 4 deletions transverb/gui/transverbeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ enum
constexpr auto kDisplayFont = dfx::kFontName_Snooty10px;
constexpr DGColor kDisplayTextColor(103, 161, 215);
constexpr auto kDisplayTextSize = dfx::kFontSize_Snooty10px;
constexpr float kUnusedControlAlpha = 0.39f;
constexpr float kFineTuneInc = 0.0001f;
constexpr float kSemitonesPerOctave = 12.0f;

Expand Down Expand Up @@ -442,6 +443,7 @@ long TransverbEditor::OpenEditor()
pos.set(kSpeedModeButtonX, kSpeedModeButtonY + (((kWideFaderInc * 2) + kWideFaderMoreInc) * speedModeIndex),
speedModeButtonImage->getWidth() / 2, speedModeButtonImage->getHeight() / kSpeedMode_NumModes);
mSpeedModeButtons[speedModeIndex] = emplaceControl<DGButton>(this, pos, speedModeButtonImage, kSpeedMode_NumModes, DGButton::Mode::Increment, true);
// TODO: C++20 bind_front
mSpeedModeButtons[speedModeIndex]->setUserProcedure(std::bind(&TransverbEditor::HandleSpeedModeButton, this, speedModeIndex, std::placeholders::_1));
}

Expand Down Expand Up @@ -489,6 +491,7 @@ void TransverbEditor::PostOpenEditor()
{
HandleSpeedModeChange(i);
}
HandleFreezeChange();
}

//-----------------------------------------------------------------------------
Expand All @@ -503,11 +506,16 @@ void TransverbEditor::CloseEditor()
//-----------------------------------------------------------------------------
void TransverbEditor::parameterChanged(long inParameterID)
{
if (inParameterID == kBsize)
switch (inParameterID)
{
// trigger re-conversion of numerical value to text
std::for_each(mDistanceTextDisplays.begin(), mDistanceTextDisplays.end(),
[](auto& display){ display->refreshText(); });
case kBsize:
// trigger re-conversion of numerical value to text
std::for_each(mDistanceTextDisplays.begin(), mDistanceTextDisplays.end(),
[](auto& display){ display->refreshText(); });
break;
case kFreeze:
HandleFreezeChange();
break;
}
}

Expand Down Expand Up @@ -547,3 +555,11 @@ void TransverbEditor::HandleSpeedModeChange(size_t inIndex)
mSpeedUpButtons.at(inIndex)->setTuneMode(*tuneMode);
}
}

//-----------------------------------------------------------------------------
void TransverbEditor::HandleFreezeChange()
{
float const alpha = getparameter_b(kFreeze) ? kUnusedControlAlpha : 1.f;
std::for_each(kFeedParameters.cbegin(), kFeedParameters.cend(),
[this, alpha](auto parameterID){ SetParameterAlpha(parameterID, alpha); });
}
3 changes: 2 additions & 1 deletion transverb/gui/transverbeditor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*------------------------------------------------------------------------
Copyright (C) 2001-2021 Tom Murphy 7 and Sophia Poirier
Copyright (C) 2001-2022 Tom Murphy 7 and Sophia Poirier
This file is part of Transverb.
Expand Down Expand Up @@ -66,6 +66,7 @@ class TransverbEditor final : public DfxGuiEditor
private:
void HandleSpeedModeButton(size_t inIndex, long inValue);
void HandleSpeedModeChange(size_t inIndex);
void HandleFreezeChange();

std::array<DGButton*, dfx::TV::kNumDelays> mSpeedModeButtons {};
std::array<TransverbSpeedTuneButton*, dfx::TV::kNumDelays> mSpeedDownButtons {}, mSpeedUpButtons {};
Expand Down

0 comments on commit a723925

Please sign in to comment.