Skip to content

Commit

Permalink
update processors
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreya-Autumn committed May 9, 2024
1 parent 9969b19 commit b50219a
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

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

namespace sst::voice_effects::distortion
namespace sst::voice_effects::delay
{
template <typename VFXConfig> struct MicroGate : core::VoiceEffectTemplateBase<VFXConfig>
{
Expand Down Expand Up @@ -209,6 +209,6 @@ template <typename VFXConfig> struct MicroGate : core::VoiceEffectTemplateBase<V

sst::basic_blocks::dsp::lipol<float, VFXConfig::blockSize, true> mReductionLerp;
};
} // namespace sst::voice_effects::distortion
} // namespace sst::voice_effects::delay

#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* https://github.com/surge-synthesizer/sst-effects
*/

#ifndef INCLUDE_SST_VOICE_EFFECTS_DELAY_STRINGEXCITER_H
#define INCLUDE_SST_VOICE_EFFECTS_DELAY_STRINGEXCITER_H
#ifndef INCLUDE_SST_VOICE_EFFECTS_DELAY_StringResonator_H
#define INCLUDE_SST_VOICE_EFFECTS_DELAY_StringResonator_H

#include "sst/basic-blocks/params/ParamMetadata.h"
#include "sst/basic-blocks/dsp/QuadratureOscillators.h"
Expand All @@ -37,7 +37,7 @@

namespace sst::voice_effects::delay
{
template <typename VFXConfig> struct StringExciter : core::VoiceEffectTemplateBase<VFXConfig>
template <typename VFXConfig> struct StringResonator : core::VoiceEffectTemplateBase<VFXConfig>
{
static constexpr const char *effectName{"String Exciter"};

Expand All @@ -59,13 +59,13 @@ template <typename VFXConfig> struct StringExciter : core::VoiceEffectTemplateBa
fpStiffness,
};

StringExciter(const SincTable &st)
StringResonator(const SincTable &st)
: sSincTable(st), core::VoiceEffectTemplateBase<VFXConfig>(), lp(this), hp(this)
{
std::fill(mLastParam.begin(), mLastParam.end(), -188888.f);
}

~StringExciter()
~StringResonator()
{
if (isShort)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* https://github.com/surge-synthesizer/sst-effects
*/

#ifndef INCLUDE_SST_VOICE_EFFECTS_DELAY_FAUXSTEREO_H
#define INCLUDE_SST_VOICE_EFFECTS_DELAY_FAUXSTEREO_H
#ifndef INCLUDE_SST_VOICE_EFFECTS_DELAY_Widener_H
#define INCLUDE_SST_VOICE_EFFECTS_DELAY_Widener_H

#include "sst/basic-blocks/params/ParamMetadata.h"
#include "sst/basic-blocks/dsp/QuadratureOscillators.h"
Expand All @@ -37,9 +37,9 @@

namespace sst::voice_effects::delay
{
template <typename VFXConfig> struct FauxStereo : core::VoiceEffectTemplateBase<VFXConfig>
template <typename VFXConfig> struct Widener : core::VoiceEffectTemplateBase<VFXConfig>
{
static constexpr const char *effectName{"Faux Stereo"};
static constexpr const char *effectName{"Widener"};

static constexpr int numFloatParams{3};
static constexpr int numIntParams{0};
Expand All @@ -50,12 +50,12 @@ template <typename VFXConfig> struct FauxStereo : core::VoiceEffectTemplateBase<

const SincTable &sSincTable;

FauxStereo(const SincTable &st) : sSincTable(st), core::VoiceEffectTemplateBase<VFXConfig>()
Widener(const SincTable &st) : sSincTable(st), core::VoiceEffectTemplateBase<VFXConfig>()
{
std::fill(mLastParam.begin(), mLastParam.end(), -188888.f);
}

~FauxStereo()
~Widener()
{
if (isShort)
lineSupport.returnLines<shortLineSize>(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "sst/basic-blocks/params/ParamMetadata.h"
#include "../VoiceEffectCore.h"

namespace sst::voice_effects::distortion
namespace sst::voice_effects::filter
{
template <typename VFXConfig> struct Slewer : core::VoiceEffectTemplateBase<VFXConfig>
{
Expand Down Expand Up @@ -172,6 +172,6 @@ template <typename VFXConfig> struct Slewer : core::VoiceEffectTemplateBase<VFXC

sst::basic_blocks::dsp::lipol_sse<VFXConfig::blockSize, true> lipolRate;
};
} // namespace sst::voice_effects::distortion
} // namespace sst::voice_effects::filter

#endif // SHORTCIRCUITXT_BITCRUSHER_H
2 changes: 1 addition & 1 deletion include/sst/voice-effects/generator/GenCorrelatedNoise.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ template <typename VFXConfig> struct GenCorrelatedNoise : core::VoiceEffectTempl
case GenCorrelatedNoiseFloatParams::color:
return pmd().asPercentBipolar().withName("Color");
case GenCorrelatedNoiseFloatParams::level:
return pmd().asCubicDecibelAttenuation().withDefault(1.f).withName("Level");
return pmd().asCubicDecibelAttenuation().withDefault(0.5f).withName("Level");
default:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion include/sst/voice-effects/generator/GenPulseSync.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ template <typename VFXConfig> struct GenPulseSync : core::VoiceEffectTemplateBas
.withDefault(0)
.withLinearScaleFormatting("semitones");
case GenPulseSyncFloatParams::level:
return pmd().asCubicDecibelAttenuation().withDefault(1.f).withName("Level");
return pmd().asCubicDecibelAttenuation().withDefault(0.5f).withName("Level");

default:
break;
Expand Down
2 changes: 1 addition & 1 deletion include/sst/voice-effects/generator/GenSaw.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ template <typename VFXConfig> struct GenSaw : core::VoiceEffectTemplateBase<VFXC
.withLinearScaleFormatting("semitones")
.withName("Tune");
case GenSawFloatParams::level:
return pmd().asCubicDecibelAttenuation().withDefault(1.f).withName("Level");
return pmd().asCubicDecibelAttenuation().withDefault(0.5f).withName("Level");
default:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion include/sst/voice-effects/generator/GenSin.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ template <typename VFXConfig> struct GenSin : core::VoiceEffectTemplateBase<VFXC
.withLinearScaleFormatting("semitones")
.withName("Tune");
case GenSinFloatParams::level:
return pmd().asCubicDecibelAttenuation().withDefault(1.f).withName("Level");
return pmd().asCubicDecibelAttenuation().withDefault(0.5f).withName("Level");
default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* https://github.com/surge-synthesizer/sst-effects
*/

#ifndef INCLUDE_SST_VOICE_EFFECTS_PITCH_PITCHRING_H
#define INCLUDE_SST_VOICE_EFFECTS_PITCH_PITCHRING_H
#ifndef INCLUDE_SST_VOICE_EFFECTS_MODULATION_FREQSHIFTMOD_H
#define INCLUDE_SST_VOICE_EFFECTS_MODULATION_FREQSHIFTMOD_H

#include "sst/basic-blocks/params/ParamMetadata.h"
#include "sst/basic-blocks/dsp/HilbertTransform.h"
Expand All @@ -31,54 +31,54 @@

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

namespace sst::voice_effects::pitch
namespace sst::voice_effects::modulation
{
template <typename VFXConfig> struct PitchRing : core::VoiceEffectTemplateBase<VFXConfig>
template <typename VFXConfig> struct FreqShiftMod : core::VoiceEffectTemplateBase<VFXConfig>
{
static constexpr const char *effectName{"PitchRing"};
static constexpr const char *effectName{"Freq Shift Mod"};

enum struct PitchRingFloatParams : uint32_t
enum struct FreqShiftModFloatParams : uint32_t
{
fine,
coarse,
feedback,
num_params
};

enum struct PitchRingIntParams : uint32_t
enum struct FreqShiftModIntParams : uint32_t
{
num_params
};

static constexpr int numFloatParams{(int)PitchRingFloatParams::num_params};
static constexpr int numIntParams{(int)PitchRingIntParams::num_params};
static constexpr int numFloatParams{(int)FreqShiftModFloatParams::num_params};
static constexpr int numIntParams{(int)FreqShiftModIntParams::num_params};

PitchRing() : core::VoiceEffectTemplateBase<VFXConfig>() {}
FreqShiftMod() : core::VoiceEffectTemplateBase<VFXConfig>() {}

~PitchRing() {}
~FreqShiftMod() {}

basic_blocks::params::ParamMetaData paramAt(int idx) const
{
assert(idx >= 0 && idx < (int)PitchRingFloatParams::num_params);
assert(idx >= 0 && idx < (int)FreqShiftModFloatParams::num_params);
using pmd = basic_blocks::params::ParamMetaData;

switch ((PitchRingFloatParams)idx)
switch ((FreqShiftModFloatParams)idx)
{
case PitchRingFloatParams::fine:
case FreqShiftModFloatParams::fine:
return pmd()
.asFloat()
.withName("Fine")
.withLinearScaleFormatting("hz")
.withRange(-10, 10)
.withDefault(0);
case PitchRingFloatParams::coarse:
case FreqShiftModFloatParams::coarse:
return pmd()
.asFloat()
.withName("Coarse")
.withLinearScaleFormatting("hz")
.withRange(-1000, 1000)
.withDefault(0);
case PitchRingFloatParams::feedback:
case FreqShiftModFloatParams::feedback:
return pmd().asPercentBipolar().withName("Feedback").withDefault(0);
default:
break;
Expand All @@ -97,11 +97,11 @@ template <typename VFXConfig> struct PitchRing : core::VoiceEffectTemplateBase<V
void processStereo(float *datainL, float *datainR, float *dataoutL, float *dataoutR,
float pitch)
{
auto rate = this->getFloatParam((int)PitchRingFloatParams::coarse) +
this->getFloatParam((int)PitchRingFloatParams::fine);
auto rate = this->getFloatParam((int)FreqShiftModFloatParams::coarse) +
this->getFloatParam((int)FreqShiftModFloatParams::fine);
mSinOsc.setRate(2.0 * M_PI * rate * this->getSampleRateInv());

auto fbp = this->getFloatParam((int)PitchRingFloatParams::feedback) * 0.75;
auto fbp = this->getFloatParam((int)FreqShiftModFloatParams::feedback) * 0.75;
mFeedbackLerp.newValue(fbp);

for (auto i = 0U; i < VFXConfig::blockSize; ++i)
Expand Down Expand Up @@ -138,6 +138,6 @@ template <typename VFXConfig> struct PitchRing : core::VoiceEffectTemplateBase<V

sst::basic_blocks::dsp::lipol<float, VFXConfig::blockSize, true> mFeedbackLerp;
};
} // namespace sst::voice_effects::pitch
} // namespace sst::voice_effects::modulation

#endif // SHORTCIRCUITXT_PitchRing_H
#endif // SHORTCIRCUITXT_FreqShiftMod_H
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* https://github.com/surge-synthesizer/sst-effects
*/

#ifndef INCLUDE_SST_VOICE_EFFECTS_GENERATOR_GENPHASEMOD_H
#define INCLUDE_SST_VOICE_EFFECTS_GENERATOR_GENPHASEMOD_H
#ifndef INCLUDE_SST_VOICE_EFFECTS_MODULATION_PHASEMOD_H
#define INCLUDE_SST_VOICE_EFFECTS_MODULATION_PHASEMOD_H

#include "sst/basic-blocks/params/ParamMetadata.h"
#include "sst/basic-blocks/dsp/FastMath.h"
Expand All @@ -31,46 +31,46 @@

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

namespace sst::voice_effects::generator
namespace sst::voice_effects::modulation
{
template <typename VFXConfig> struct GenPhaseMod : core::VoiceEffectTemplateBase<VFXConfig>
template <typename VFXConfig> struct PhaseMod : core::VoiceEffectTemplateBase<VFXConfig>
{
static constexpr const char *effectName{"GenPhaseMod"};
static constexpr const char *effectName{"PhaseMod"};

enum struct GenPhaseModFloatParams : uint32_t
enum struct PhaseModFloatParams : uint32_t
{
transpose,
depth,
num_params
};

enum struct GenPhaseModIntParams : uint32_t
enum struct PhaseModIntParams : uint32_t
{
num_params
};

static constexpr int numFloatParams{(int)GenPhaseModFloatParams::num_params};
static constexpr int numIntParams{(int)GenPhaseModIntParams::num_params};
static constexpr int numFloatParams{(int)PhaseModFloatParams::num_params};
static constexpr int numIntParams{(int)PhaseModIntParams::num_params};

GenPhaseMod() : core::VoiceEffectTemplateBase<VFXConfig>(), pre(6, true), post(6, true) {}
PhaseMod() : core::VoiceEffectTemplateBase<VFXConfig>(), pre(6, true), post(6, true) {}

~GenPhaseMod() {}
~PhaseMod() {}

basic_blocks::params::ParamMetaData paramAt(int idx) const
{
assert(idx >= 0 && idx < (int)GenPhaseModFloatParams::num_params);
assert(idx >= 0 && idx < (int)PhaseModFloatParams::num_params);
using pmd = basic_blocks::params::ParamMetaData;

switch ((GenPhaseModFloatParams)idx)
switch ((PhaseModFloatParams)idx)
{
case GenPhaseModFloatParams::transpose:
case PhaseModFloatParams::transpose:
return pmd()
.asFloat()
.withRange(-96, 96)
.withLinearScaleFormatting("semitones")
.withDefault(0)
.withName("Transpose");
case GenPhaseModFloatParams::depth:
case PhaseModFloatParams::depth:
return pmd().asDecibel().withName("Depth").withDefault(0);
default:
break;
Expand All @@ -89,10 +89,10 @@ template <typename VFXConfig> struct GenPhaseMod : core::VoiceEffectTemplateBase

omega.set_target(0.5 * 440 *
this->note_to_pitch_ignoring_tuning(
pitch + this->getFloatParam((int)GenPhaseModFloatParams::transpose)) *
pitch + this->getFloatParam((int)PhaseModFloatParams::transpose)) *
M_PI_2 * this->getSampleRateInv());
pregain.set_target(
3.1415 * this->dbToLinear(this->getFloatParam((int)GenPhaseModFloatParams::depth)));
3.1415 * this->dbToLinear(this->getFloatParam((int)PhaseModFloatParams::depth)));

constexpr int bs2 = VFXConfig::blockSize << 1;
float OS alignas(16)[2][bs2];
Expand Down Expand Up @@ -139,10 +139,10 @@ template <typename VFXConfig> struct GenPhaseMod : core::VoiceEffectTemplateBase

omega.set_target(0.5 * 440 *
this->note_to_pitch_ignoring_tuning(
pitch + this->getFloatParam((int)GenPhaseModFloatParams::transpose)) *
pitch + this->getFloatParam((int)PhaseModFloatParams::transpose)) *
M_PI_2 * this->getSampleRateInv());
pregain.set_target(
3.1415 * this->dbToLinear(this->getFloatParam((int)GenPhaseModFloatParams::depth)));
3.1415 * this->dbToLinear(this->getFloatParam((int)PhaseModFloatParams::depth)));

constexpr int bs2 = VFXConfig::blockSize << 1;
float OS alignas(16)[2][bs2];
Expand Down Expand Up @@ -185,6 +185,6 @@ template <typename VFXConfig> struct GenPhaseMod : core::VoiceEffectTemplateBase
sst::basic_blocks::dsp::lipol_sse<VFXConfig::blockSize> pregain;
sst::basic_blocks::dsp::lipol_sse<VFXConfig::blockSize << 1, true> omega;
};
} // namespace sst::voice_effects::generator
} // namespace sst::voice_effects::modulation

#endif // SHORTCIRCUITXT_GenPhaseMod_H
#endif // SHORTCIRCUITXT_PhaseMod_H
Loading

0 comments on commit b50219a

Please sign in to comment.