Skip to content

Commit

Permalink
Remove some == true / == false idioms (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul authored Nov 25, 2024
1 parent eb3ae4c commit bf9bd09
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions include/sst/voice-effects/delay/StringResonator.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ template <typename VFXConfig> struct StringResonator : core::VoiceEffectTemplate

auto panParamOne = std::clamp((this->getFloatParam(fpPanOne) * .5f + .5f), 0.f, 1.f);
auto panParamTwo = std::clamp((this->getFloatParam(fpPanTwo) * .5f + .5f), 0.f, 1.f);
if (this->getIntParam(ipStereo) == false)
if (!this->getIntParam(ipStereo))
{
panParamOne = 0.5f;
panParamTwo = 0.5f;
Expand Down Expand Up @@ -370,7 +370,7 @@ template <typename VFXConfig> struct StringResonator : core::VoiceEffectTemplate
levelLerpOne.set_target(levelParam);

auto panParam = std::clamp((this->getFloatParam(fpPanOne) * .5f + .5f), 0.f, 1.f);
if (this->getIntParam(ipStereo) == false)
if (!this->getIntParam(ipStereo))
{
panParam = 0.5f;
}
Expand Down Expand Up @@ -663,7 +663,7 @@ template <typename VFXConfig> struct StringResonator : core::VoiceEffectTemplate
void processStereo(const float *const datainL, const float *const datainR, float *dataoutL,
float *dataoutR, float pitch)
{
if (this->getIntParam(ipDualString == true))
if (this->getIntParam(ipDualString))
{
if (isShort)
{
Expand Down Expand Up @@ -702,7 +702,7 @@ template <typename VFXConfig> struct StringResonator : core::VoiceEffectTemplate

void processMonoToMono(const float *const datainL, float *dataoutL, float pitch)
{
if (this->getIntParam(ipDualString == true))
if (this->getIntParam(ipDualString))
{
if (isShort)
{
Expand Down
4 changes: 2 additions & 2 deletions include/sst/voice-effects/distortion/BitCrusher.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ template <typename VFXConfig> struct BitCrusher : core::VoiceEffectTemplateBase<
}
auto filterFreq = 440 * this->note_to_pitch_ignoring_tuning(cutoff);

if (priorFreq != filterFreq && filterSwitch == true)
if (priorFreq != filterFreq && filterSwitch)
{
filter.template setCoeffForBlock<VFXConfig::blockSize>(mode, filterFreq, reso,
this->getSampleRateInv(), 0.f);
Expand Down Expand Up @@ -184,7 +184,7 @@ template <typename VFXConfig> struct BitCrusher : core::VoiceEffectTemplateBase<
dataoutL[k] = level[0];
dataoutR[k] = level[1];
}
if (filterSwitch == true)
if (filterSwitch)
{
filter.processBlock<VFXConfig::blockSize>(dataoutL, dataoutR, dataoutL, dataoutR);
}
Expand Down
4 changes: 2 additions & 2 deletions include/sst/voice-effects/filter/CytomicSVF.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ template <typename VFXConfig> struct CytomicSVF : core::VoiceEffectTemplateBase<
auto mode = (sst::filters::CytomicSVF::Mode)(iparam[0]);

auto res = std::clamp(param[2], 0.f, 1.f);
if (iparam[2] == true)
if (iparam[2])
{
res *= .885f; // I just checked peak heights on a spectrum analyzer.
}
Expand Down Expand Up @@ -245,7 +245,7 @@ template <typename VFXConfig> struct CytomicSVF : core::VoiceEffectTemplateBase<
{
calc_coeffs(pitch);
cySvf[0].template processBlock<VFXConfig::blockSize>(datainL, datainR, dataoutL, dataoutR);
if (this->getIntParam(ipSlope) == true)
if (this->getIntParam(ipSlope))
{
cySvf[1].template processBlock<VFXConfig::blockSize>(dataoutL, dataoutR, dataoutL,
dataoutR);
Expand Down
4 changes: 2 additions & 2 deletions include/sst/voice-effects/modulation/Tremolo.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ template <typename VFXConfig> struct Tremolo : core::VoiceEffectTemplateBase<VFX
void processStereo(const float *const datainL, const float *const datainR, float *dataoutL,
float *dataoutR, float pitch)
{
if (this->getIntParam(ipHarmonic) == true)
if (this->getIntParam(ipHarmonic))
{
harmonicStereo(datainL, datainR, dataoutL, dataoutR, pitch);
}
Expand All @@ -470,7 +470,7 @@ template <typename VFXConfig> struct Tremolo : core::VoiceEffectTemplateBase<VFX
// ...this second one if incoming audio is Mono...
void processMonoToMono(const float *const datainL, float *dataoutL, float pitch)
{
if (this->getIntParam(ipHarmonic) == true)
if (this->getIntParam(ipHarmonic))
{
harmonicMono(datainL, dataoutL, pitch);
}
Expand Down

0 comments on commit bf9bd09

Please sign in to comment.