SquidgeDSP/core/Clipper.hpp

23 lines
516 B
C++
Raw Normal View History

2026-08-02 20:03:04 +01:00
#ifndef CLIPPER_HPP_INCLUDED
#define CLIPPER_HPP_INCLUDED
#include <cstdint>
class Clipper {
public:
Clipper(float init_clip = 1.0f);
void process(const float *in, float *out, uint32_t frames);
void processStereo(const float *inLeft, const float *inRight, float *outLeft,
float *outRight, uint32_t frames);
private:
float clip_;
float clip(const float in);
2026-08-02 20:03:04 +01:00
public:
void setGain(float c) { clip_ = c; }
float getGain() const { return clip_; }
};
#endif // CLIPPER_HPP_INCLUDED