34 int32_t userDelayRate;
35 int32_t delayFeedbackAmount;
36 int32_t analog_saturation = 8;
40 Delay(
const Delay& other) =
delete;
43 Delay& operator=(
const Delay& rhs) {
44 pingPong = rhs.pingPong;
46 syncLevel = rhs.syncLevel;
50 [[nodiscard]]
constexpr bool isActive()
const {
return (primaryBuffer.isActive() || secondaryBuffer.isActive()); }
52 void informWhetherActive(
bool newActive, int32_t userDelayRate = 0);
53 void copySecondaryToPrimary();
54 void copyPrimaryToSecondary();
55 void initializeSecondaryBuffer(int32_t newNativeRate,
bool makeNativeRatePreciseRelativeToOtherBuffer);
56 void setupWorkingState(State& workingState, uint32_t timePerInternalTickInverse,
bool anySoundComingIn =
true);
57 void discardBuffers();
58 void setTimeToAbandon(
const State& workingState);
61 DelayBuffer primaryBuffer;
62 DelayBuffer secondaryBuffer;
63 ImpulseResponseProcessor ir_processor;
65 uint32_t countCyclesWithoutChange;
66 int32_t userRateLastTime;
70 SyncType syncType = SYNC_TYPE_EVEN;
73 SyncLevel syncLevel = SYNC_LEVEL_16TH;
75 int32_t sizeLeftUntilBufferSwap;
80 int32_t prevFeedback = 0;
82 uint8_t repeatsUntilAbandon = 0;
84 void process(StereoBuffer<q31_t> buffer,
const State& delayWorkingState);
87 void prepareToBeginWriting();
88 [[nodiscard]]
constexpr int32_t getAmountToWriteBeforeReadingBegins()
const {
return secondaryBuffer.size(); }