Skip to content

Commit

Permalink
floats
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreya-Autumn committed Oct 15, 2024
1 parent d640567 commit 693e16c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/sst/voice-effects/eq/TiltEQ.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "../VoiceEffectCore.h"

#include <iostream>
#include <algorithm>

#include "sst/basic-blocks/mechanics/block-ops.h"

Expand Down Expand Up @@ -73,7 +74,7 @@ template <typename VFXConfig> struct TiltEQ : core::VoiceEffectTemplateBase<VFXC
void setCoeffs()
{
float freq = 440 * this->note_to_pitch_ignoring_tuning(this->getFloatParam(fpFreq));
float slope = std::clamp(this->getFloatParam(fpTilt), -18, 18) / 2;
float slope = std::clamp(this->getFloatParam(fpTilt), -18.f, 18.f) / 2.f;

float posGain = this->dbToLinear(slope);
float negGain = this->dbToLinear(-1 * slope);
Expand Down
2 changes: 1 addition & 1 deletion include/sst/voice-effects/generator/TiltNoise.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ template <typename VFXConfig> struct TiltNoise : core::VoiceEffectTemplateBase<V

void setCoeffs()
{
float slope = std::clamp(this->getFloatParam(fpTilt), -6, 6) / 2;
float slope = std::clamp(this->getFloatParam(fpTilt), -6.f, 6.f) / 2.f;
float posGain = this->dbToLinear(slope);
float negGain = this->dbToLinear(-1 * slope);
float res = .07f;
Expand Down
2 changes: 1 addition & 1 deletion include/sst/voice-effects/modulation/NoiseAM.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ template <typename VFXConfig> struct NoiseAM : core::VoiceEffectTemplateBase<VFX

void setCoeffs()
{
float slope = std::clamp(this->getFloatParam(fpTilt), -6, 6) / 2;
float slope = std::clamp(this->getFloatParam(fpTilt), -6.f, 6.f) / 2.f;
float posGain = this->dbToLinear(slope);
float negGain = this->dbToLinear(-1 * slope);
float res = .07f;
Expand Down

0 comments on commit 693e16c

Please sign in to comment.