You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

33 lines
744 B

#pragma once
#ifndef LIMITER_H
#define LIMITER_H
#include <stdlib.h>
namespace daisysp
{
/** Simple Peak Limiter
This was extracted from pichenettes/stmlib.
Credit to pichenettes/Mutable Instruments
*/
class Limiter
{
public:
Limiter() {}
~Limiter() {}
/** Initializes the Limiter instance.
*/
void Init();
/** Processes a block of audio through the limiter.
\param in - pointer to a block of audio samples to be processed. The buffer is operated on directly.
\param size - size of the buffer "in"
\param pre_gain - amount of pre_gain applied to the signal.
*/
void ProcessBlock(float *in, size_t size, float pre_gain);
private:
float peak_;
};
} // namespace daisysp
#endif