Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

...or algorithm problems #151

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 2 additions & 1 deletion include/sst/voice-effects/generator/TiltNoise.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <iostream>
#include <math.h>
#include <algorithm>

#include "sst/basic-blocks/params/ParamMetadata.h"
#include "sst/basic-blocks/dsp/RNG.h"
Expand Down Expand Up @@ -96,7 +97,7 @@ template <typename VFXConfig> struct TiltNoise : core::VoiceEffectTemplateBase<V

void setCoeffs()
{
float slope = 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
3 changes: 2 additions & 1 deletion include/sst/voice-effects/modulation/NoiseAM.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <iostream>
#include <math.h>
#include <algorithm>

#include "sst/basic-blocks/params/ParamMetadata.h"
#include "sst/basic-blocks/dsp/BlockInterpolators.h"
Expand Down Expand Up @@ -111,7 +112,7 @@ template <typename VFXConfig> struct NoiseAM : core::VoiceEffectTemplateBase<VFX

void setCoeffs()
{
float slope = 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
Loading