Skip to content

Commit

Permalink
add floaty delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreya-Autumn committed Sep 26, 2024
1 parent 86c8ec7 commit 6276483
Show file tree
Hide file tree
Showing 10 changed files with 221 additions and 8 deletions.
2 changes: 1 addition & 1 deletion libs/sst/sst-effects
Submodule sst-effects updated 52 files
+4 −4 include/sst/effects-shared/TreemonsterCore.h
+9 −0 include/sst/effects/Bonsai.h
+8 −0 include/sst/effects/Delay.h
+9 −0 include/sst/effects/EffectCore.h
+8 −0 include/sst/effects/Flanger.h
+356 −0 include/sst/effects/FloatyDelay.h
+18 −0 include/sst/effects/Nimbus.h
+1 −0 include/sst/effects/NimbusImpl.h
+9 −0 include/sst/effects/Phaser.h
+9 −0 include/sst/effects/Reverb1.h
+8 −0 include/sst/effects/Reverb2.h
+9 −0 include/sst/effects/RotarySpeaker.h
+9 −0 include/sst/effects/TreeMonster.h
+18 −7 include/sst/voice-effects/delay/Chorus.h
+10 −0 include/sst/voice-effects/delay/DelaySupport.h
+12 −2 include/sst/voice-effects/delay/Microgate.h
+18 −7 include/sst/voice-effects/delay/ShortDelay.h
+22 −11 include/sst/voice-effects/delay/StringResonator.h
+14 −4 include/sst/voice-effects/delay/Widener.h
+12 −2 include/sst/voice-effects/distortion/BitCrusher.h
+13 −3 include/sst/voice-effects/distortion/Slewer.h
+12 −2 include/sst/voice-effects/distortion/TreeMonster.h
+12 −2 include/sst/voice-effects/dynamics/AutoWah.h
+13 −3 include/sst/voice-effects/dynamics/Compressor.h
+16 −6 include/sst/voice-effects/eq/EqGraphic6Band.h
+16 −6 include/sst/voice-effects/eq/EqNBandParametric.h
+13 −3 include/sst/voice-effects/eq/MorphEQ.h
+13 −3 include/sst/voice-effects/eq/TiltEQ.h
+15 −4 include/sst/voice-effects/filter/CytomicSVF.h
+13 −3 include/sst/voice-effects/filter/SSTFilters.h
+15 −4 include/sst/voice-effects/filter/StaticPhaser.h
+10 −0 include/sst/voice-effects/filter/SurgeBiquads.h
+15 −4 include/sst/voice-effects/generator/GenCorrelatedNoise.h
+16 −6 include/sst/voice-effects/generator/GenVA.h
+15 −4 include/sst/voice-effects/generator/TiltNoise.h
+12 −2 include/sst/voice-effects/lifted_bus_effects/LiftedDelay.h
+12 −2 include/sst/voice-effects/lifted_bus_effects/LiftedFlanger.h
+12 −2 include/sst/voice-effects/lifted_bus_effects/LiftedReverb1.h
+12 −2 include/sst/voice-effects/lifted_bus_effects/LiftedReverb2.h
+15 −4 include/sst/voice-effects/modulation/FMFilter.h
+12 −2 include/sst/voice-effects/modulation/FreqShiftMod.h
+15 −4 include/sst/voice-effects/modulation/NoiseAM.h
+13 −3 include/sst/voice-effects/modulation/PhaseMod.h
+15 −4 include/sst/voice-effects/modulation/Phaser.h
+13 −3 include/sst/voice-effects/modulation/RingMod.h
+15 −4 include/sst/voice-effects/modulation/ShepardPhaser.h
+21 −10 include/sst/voice-effects/modulation/Tremolo.h
+12 −2 include/sst/voice-effects/utilities/GainMatrix.h
+12 −2 include/sst/voice-effects/utilities/StereoTool.h
+14 −2 include/sst/voice-effects/utilities/VolumeAndPan.h
+15 −4 include/sst/voice-effects/waveshaper/WaveShaper.h
+6 −1 tests/create-effect.cpp
5 changes: 4 additions & 1 deletion resources/surge-shared/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@
<snapshot name="Init (Send)" p0="0.500000" p1="0.500000" p2="1.000000" p3="0.500000" p4="0.500000" p5="0.000000"
p6="0.000000" p7="1.000000"/>
</type>
<type i="30" name="Floaty Delay">
<snapshot name="Init" p0="-1.73699" p1="1.0" p2="0.5" p3="20.0" p4="0.5" p5="0.0" p6="0.0" p7="0.0" p8="0.0" p9="0.3"/>
</type>
<sectionheader label="MULTIEFFECTS"/>
<type i="14" name="Airwindows">
<snapshot name="Init" p0="46" p1="1.000000" p2="0.000000" p3="1.000000"/>
Expand Down Expand Up @@ -172,4 +175,4 @@
<entry p="6" ctrl="47" chan="-1"/>
<entry p="7" ctrl="48" chan="-1"/>
</customctrl>
<midictrl/>
<midictrl/>
2 changes: 2 additions & 0 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ add_library(${PROJECT_NAME}
dsp/effects/DistortionEffect.h
dsp/effects/FlangerEffect.cpp
dsp/effects/FlangerEffect.h
dsp/effects/FloatyDelayEffect.cpp
dsp/effects/FloatyDelayEffect.h
dsp/effects/FrequencyShifterEffect.cpp
dsp/effects/FrequencyShifterEffect.h
dsp/effects/GraphicEQ11BandEffect.cpp
Expand Down
26 changes: 26 additions & 0 deletions src/common/Parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ bool Parameter::is_bipolar() const
case ct_pitch4oct:
case ct_modern_trimix:
case ct_oscspread_bipolar:
case ct_floaty_delay_playrate:
case ct_bonsai_bass_boost:
res = true;
break;
Expand Down Expand Up @@ -793,6 +794,18 @@ void Parameter::set_type(int ctrltype)
val_max.f = 5;
val_default.f = 0;
break;
case ct_floaty_warp_time:
valtype = vt_float;
val_min.f = -3;
val_max.f = 4;
val_default.f = 0;
break;
case ct_floaty_delay_time:
valtype = vt_float;
val_min.f = -5.64386; // 20ms
val_max.f = 3; // 8s
val_default.f = -1.73697; // 300ms
break;
case ct_delaymodtime:
case ct_chorusmodtime:
valtype = vt_float;
Expand Down Expand Up @@ -1362,6 +1375,13 @@ void Parameter::set_type(int ctrltype)
val_max.i = 1;
break;

case ct_floaty_delay_playrate:
valtype = vt_float;
val_min.f = -5.f;
val_default.f = 1.f;
val_max.f = 5.f;
break;

case ct_none:
default:
snprintf(dispname, NAMECHARS, "-");
Expand Down Expand Up @@ -1407,6 +1427,9 @@ void Parameter::set_type(int ctrltype)
case ct_lfophaseshuffle:
case ct_reson_res_extendable:
case ct_modern_trimix:
case ct_floaty_warp_time:
case ct_floaty_delay_time:
case ct_floaty_delay_playrate:
case ct_alias_mask:
case ct_tape_drive:
displayType = LinearWithScale;
Expand Down Expand Up @@ -4470,6 +4493,9 @@ bool Parameter::can_setvalue_from_string() const
case ct_tape_speed:
case ct_spring_decay:
case ct_bonsai_bass_boost:
case ct_floaty_warp_time:
case ct_floaty_delay_time:
case ct_floaty_delay_playrate:
{
return true;
}
Expand Down
3 changes: 3 additions & 0 deletions src/common/Parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ enum ctrltypes
ct_bonsai_sat_filter,
ct_bonsai_sat_mode,
ct_bonsai_noise_mode,
ct_floaty_warp_time,
ct_floaty_delay_time,
ct_floaty_delay_playrate,

num_ctrltypes,
};
Expand Down
13 changes: 8 additions & 5 deletions src/common/SurgeStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ enum fx_type
fxt_spring_reverb,
fxt_bonsai,
fxt_audio_input,
fxt_floaty_delay,

n_fx_types,
};
Expand Down Expand Up @@ -449,19 +450,21 @@ const char fx_type_names[n_fx_types][32] = {"Off",
"Mid-Side Tool",
"Spring Reverb",
"Bonsai",
"Audio Input"};
"Audio Input",
"Floaty Delay"};

const char fx_type_shortnames[n_fx_types][16] = {
"Off", "Delay", "Reverb 1", "Phaser", "Rotary", "Distortion",
"EQ", "Freq Shift", "Conditioner", "Chorus", "Vocoder", "Reverb 2",
"Flanger", "Ring Mod", "Airwindows", "Neuron", "Graphic EQ", "Resonator",
"CHOW", "Exciter", "Ensemble", "Combulator", "Nimbus", "Tape",
"Treemonster", "Waveshaper", "Mid-Side Tool", "Spring Reverb", "Bonsai", "Audio In"};
"Treemonster", "Waveshaper", "Mid-Side Tool", "Spring Reverb", "Bonsai", "Audio In",
"Floaty Delay"};

const char fx_type_acronyms[n_fx_types][8] = {
"OFF", "DLY", "RV1", "PH", "ROT", "DIST", "EQ", "FRQ", "DYN", "CH",
"VOC", "RV2", "FL", "RM", "AW", "NEU", "GEQ", "RES", "CHW", "XCT",
"ENS", "CMB", "NIM", "TAPE", "TM", "WS", "M-S", "SRV", "BON", "IN"};
"OFF", "DLY", "RV1", "PH", "ROT", "DIST", "EQ", "FRQ", "DYN", "CH", "VOC",
"RV2", "FL", "RM", "AW", "NEU", "GEQ", "RES", "CHW", "XCT", "ENS", "CMB",
"NIM", "TAPE", "TM", "WS", "M-S", "SRV", "BON", "IN", "FLD"};

enum fx_bypass
{
Expand Down
4 changes: 4 additions & 0 deletions src/common/dsp/Effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "chowdsp/TapeEffect.h"
#include "DebugHelpers.h"
#include "AudioInputEffect.h"
#include "FloatyDelayEffect.h"

using namespace std;

Expand Down Expand Up @@ -116,6 +117,9 @@ Effect *spawn_effect(int id, SurgeStorage *storage, FxStorage *fxdata, pdata *pd
return new BonsaiEffect(storage, fxdata, pd);
case fxt_audio_input:
return new AudioInputEffect(storage, fxdata, pd);
case fxt_floaty_delay:
return new FloatyDelayEffect(storage, fxdata, pd);

default:
return 0;
};
Expand Down
126 changes: 126 additions & 0 deletions src/common/dsp/effects/FloatyDelayEffect.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/*
* Surge XT - a free and open source hybrid synthesizer,
* built by Surge Synth Team
*
* Learn more at https://surge-synthesizer.github.io/
*
* Copyright 2018-2024, various authors, as described in the GitHub
* transaction log.
*
* Surge XT is released under the GNU General Public Licence v3
* or later (GPL-3.0-or-later). The license is found in the "LICENSE"
* file in the root of this repository, or at
* https://www.gnu.org/licenses/gpl-3.0.en.html
*
* Surge was a commercial product from 2004-2018, copyright and ownership
* held by Claes Johanson at Vember Audio during that period.
* Claes made Surge open source in September 2018.
*
* All source for Surge XT is available at
* https://github.com/surge-synthesizer/surge
*/
#include "FloatyDelayEffect.h"
#include "sst/basic-blocks/mechanics/simd-ops.h"
#include "sst/basic-blocks/mechanics/block-ops.h"
#include "sst/basic-blocks/dsp/Clippers.h"

namespace mech = sst::basic_blocks::mechanics;
namespace sdsp = sst::basic_blocks::dsp;

using namespace std;

FloatyDelayEffect::FloatyDelayEffect(SurgeStorage *storage, FxStorage *fxdata, pdata *pd)
: surge::sstfx::SurgeSSTFXBase<
sst::effects::floatydelay::FloatyDelay<surge::sstfx::SurgeFXConfig>>(storage, fxdata, pd)
{
}

FloatyDelayEffect::~FloatyDelayEffect() {}

const char *FloatyDelayEffect::group_label(int id)
{
switch (id)
{
case 0:
return "Delay";
case 1:
return "Feedback";
case 2:
return "Warp";
case 3:
return "Output";
}
return 0;
}
int FloatyDelayEffect::group_label_ypos(int id)
{
switch (id)
{
case 0:
return 1;
case 1:
return 7;
case 2:
return 15;
case 3:
return 25;
}
return 0;
}

void FloatyDelayEffect::init_ctrltypes()
{
Effect::init_ctrltypes();

fxdata->p[fld_time].set_type(ct_floaty_delay_time);
fxdata->p[fld_playrate].set_type(ct_floaty_delay_playrate);

fxdata->p[fld_feedback].set_type(ct_percent);
fxdata->p[fld_cutoff].set_type(ct_freq_audible);
fxdata->p[fld_resonance].set_type(ct_percent);

fxdata->p[fld_warp_rate].set_type(ct_floaty_warp_time);
fxdata->p[fld_warp_width].set_type(ct_percent);
fxdata->p[fld_pitch_warp_depth].set_type(ct_percent);
fxdata->p[fld_filt_warp_depth].set_type(ct_percent);

fxdata->p[fld_mix].set_type(ct_percent);

fxdata->p[fld_time].posy_offset = 1;
fxdata->p[fld_playrate].posy_offset = 1;

fxdata->p[fld_feedback].posy_offset = 3;
fxdata->p[fld_cutoff].posy_offset = 3;
fxdata->p[fld_resonance].posy_offset = 3;

fxdata->p[fld_warp_rate].posy_offset = 5;
fxdata->p[fld_warp_width].posy_offset = 5;
fxdata->p[fld_pitch_warp_depth].posy_offset = 5;
fxdata->p[fld_filt_warp_depth].posy_offset = 5;

fxdata->p[fld_mix].posy_offset = 7;

configureControlsFromFXMetadata();
}

void FloatyDelayEffect::init_default_values()
{
fxdata->p[fld_mix].val.f = .3f;

fxdata->p[fld_time].val.f = -1.73697f;
fxdata->p[fld_playrate].val.f = 1.f;
fxdata->p[fld_feedback].val.f = .5f;

fxdata->p[fld_warp_rate].val.f = 0.f;
fxdata->p[fld_pitch_warp_depth].val.f = 0.f;
fxdata->p[fld_filt_warp_depth].val.f = 0.f;
fxdata->p[fld_warp_width].val.f = 0.f;

fxdata->p[fld_cutoff].val.f = 0.f;
fxdata->p[fld_resonance].val.f = .5f;
}

void FloatyDelayEffect::handleStreamingMismatches(int streamingRevision,
int currentSynthStreamingRevision)
{
}
46 changes: 46 additions & 0 deletions src/common/dsp/effects/FloatyDelayEffect.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Surge XT - a free and open source hybrid synthesizer,
* built by Surge Synth Team
*
* Learn more at https://surge-synthesizer.github.io/
*
* Copyright 2018-2024, various authors, as described in the GitHub
* transaction log.
*
* Surge XT is released under the GNU General Public Licence v3
* or later (GPL-3.0-or-later). The license is found in the "LICENSE"
* file in the root of this repository, or at
* https://www.gnu.org/licenses/gpl-3.0.en.html
*
* Surge was a commercial product from 2004-2018, copyright and ownership
* held by Claes Johanson at Vember Audio during that period.
* Claes made Surge open source in September 2018.
*
* All source for Surge XT is available at
* https://github.com/surge-synthesizer/surge
*/

#ifndef SURGE_SRC_COMMON_DSP_EFFECTS_FLOATYDELAYEFFECT_H
#define SURGE_SRC_COMMON_DSP_EFFECTS_FLOATYDELAYEFFECT_H
#include "Effect.h"

#include "SurgeSSTFXAdapter.h"
#include "sst/effects/FloatyDelay.h"

class FloatyDelayEffect : public surge::sstfx::SurgeSSTFXBase<
sst::effects::floatydelay::FloatyDelay<surge::sstfx::SurgeFXConfig>>
{

public:
FloatyDelayEffect(SurgeStorage *storage, FxStorage *fxdata, pdata *pd);
virtual ~FloatyDelayEffect();
virtual void init_ctrltypes() override;
virtual void init_default_values() override;
virtual const char *group_label(int id) override;
virtual int group_label_ypos(int id) override;

virtual void handleStreamingMismatches(int streamingRevision,
int currentSynthStreamingRevision) override;
};

#endif // SURGE_SRC_COMMON_DSP_EFFECTS_FLOATYDELAYEFFECT_H

0 comments on commit 6276483

Please sign in to comment.