Skip to content

Commit

Permalink
Minor fixes found by cppcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
xconverge committed Dec 28, 2024
1 parent 1d98e78 commit 2190876
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Software/GuitarPedal/Effect-Modules/multi_delay_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ using namespace bkshepherd;

PitchShifter DSY_SDRAM_BSS ps_taps[4];
// Delay Max Definitions (Assumes 48kHz samplerate)
#define MAX_DELAY_TAP static_cast<size_t>(48000.0f * 8.f)
constexpr size_t MAX_DELAY_TAP = static_cast<size_t>(48000.0f * 8.f);
DelayLine<float, MAX_DELAY_TAP> DSY_SDRAM_BSS delayLineLeft0;
DelayLine<float, MAX_DELAY_TAP> DSY_SDRAM_BSS delayLineRight0;

float tap_delays[4] = {0.0f, 0.0f, 0.0f, 0.0f};
struct delay {
struct delay_multi {
DelayLine<float, MAX_DELAY_TAP> *del;
float currentDelay;
float delayTarget;
Expand All @@ -29,7 +29,7 @@ struct delay {
return read;
}
};
delay delays[2];
delay_multi delays[2];

static const char *s_typeBinNames[] = {"Follower", "Time"};
static const int s_paramCount = 13;
Expand Down
20 changes: 10 additions & 10 deletions Software/GuitarPedal/Effect-Modules/reverb_delay_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
using namespace daisysp;

// Delay Max Definitions (Assumes 48kHz samplerate)
#define MAX_DELAY \
static_cast<size_t>(48000.0f * 8.f) // 4 second max delay // Increased the max to 8 seconds, got horrible pop noise when set to 4
// seconds, increasing buffer size fixes it for some reason. TODO figure out why?
#define MAX_DELAY_REV \
static_cast<size_t>(48000.0f * 8.f) // 8 second max delay (needs to be double for reverse, since read/write pointers are going
// opposite directions in the buffer)
#define MAX_DELAY_SPREAD static_cast<size_t>(4800.0f) // 50 ms for Spread effect
constexpr size_t MAX_DELAY =
static_cast<size_t>(48000.0f * 8.f); // 4 second max delay // Increased the max to 8 seconds, got horrible pop noise when set to 4
// seconds, increasing buffer size fixes it for some reason. TODO figure out why?
constexpr size_t MAX_DELAY_REV =
static_cast<size_t>(48000.0f * 8.f); // 8 second max delay (needs to be double for reverse, since read/write pointers are going
// opposite directions in the buffer)
constexpr size_t MAX_DELAY_SPREAD = static_cast<size_t>(4800.0f); // 50 ms for Spread effect

// This is the core delay struct, which actually includes two delays,
// one for forwared/octave, and one for reverse. This is required
Expand All @@ -32,7 +32,7 @@ using namespace daisysp;
// octave delay, or create a "fading into the distance" effect for the
// forward and reverse delays. A "level" param is included for modulation
// of the output volume, for stereo panning.
struct delay {
struct delay_reverb {
DelayLineRevOct<float, MAX_DELAY> *del;
DelayLineReverse<float, MAX_DELAY_REV> *delreverse;
float currentDelay;
Expand Down Expand Up @@ -149,8 +149,8 @@ class ReverbDelayModule : public BaseEffectModule {
float m_modOscFreqMax;

// Delays
delay delayLeft;
delay delayRight;
delay_reverb delayLeft;
delay_reverb delayRight;
delay_spread delaySpread;

// Mix params
Expand Down

0 comments on commit 2190876

Please sign in to comment.