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.
44 lines
674 B
44 lines
674 B
#pragma once
|
|
#ifndef DSY_FOLD_H
|
|
#define DSY_FOLD_H
|
|
|
|
#include <stdint.h>
|
|
#ifdef __cplusplus
|
|
|
|
namespace daisysp
|
|
{
|
|
/** fold module
|
|
|
|
Original author(s) : John FFitch, Gabriel Maldonado
|
|
|
|
Year : 1998
|
|
|
|
Ported from soundpipe by Ben Sergentanis, May 2020
|
|
*/
|
|
class Fold
|
|
{
|
|
public:
|
|
Fold() {}
|
|
~Fold() {}
|
|
/** Initializes the fold module.
|
|
*/
|
|
void Init();
|
|
|
|
|
|
/** applies foldvoer distortion to input
|
|
*/
|
|
float Process(float in);
|
|
|
|
|
|
/**
|
|
\param incr : set fold increment
|
|
*/
|
|
inline void SetIncrement(float incr) { incr_ = incr; }
|
|
|
|
private:
|
|
float incr_, index_, value_;
|
|
int sample_index_;
|
|
};
|
|
} // namespace daisysp
|
|
#endif
|
|
#endif
|
|
|