2023-07-11 12:32:52 +00:00
|
|
|
#pragma once
|
|
|
|
#include "EffectApplication.h"
|
2024-10-23 11:44:31 +00:00
|
|
|
#include "../shape/OsciPoint.h"
|
2023-07-11 12:32:52 +00:00
|
|
|
|
|
|
|
class DelayEffect : public EffectApplication {
|
|
|
|
public:
|
|
|
|
DelayEffect();
|
|
|
|
~DelayEffect();
|
|
|
|
|
2024-10-23 11:44:31 +00:00
|
|
|
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
2023-07-11 12:32:52 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const static int MAX_DELAY = 192000 * 10;
|
2024-10-23 11:44:31 +00:00
|
|
|
std::vector<OsciPoint> delayBuffer = std::vector<OsciPoint>(MAX_DELAY);
|
2023-07-11 12:32:52 +00:00
|
|
|
int head = 0;
|
|
|
|
int position = 0;
|
|
|
|
int samplesSinceLastDelay = 0;
|
2024-08-26 17:09:29 +00:00
|
|
|
};
|