File comb.h¶
File List > DaisySP > DaisySP-LGPL > Source > Filters > comb.h
Go to the documentation of this file
Source Code¶
/*
Copyright (c) 2023 Electrosmith, Corp, Barry Vercoe, John ffitch, Jens Groh, Hans Mikelson, Istvan Varga
Use of this source code is governed by the LGPL V2.1
license that can be found in the LICENSE file or at
https://opensource.org/license/lgpl-2-1/
*/
#pragma once
#ifndef DSY_COMB_H
#define DSY_COMB_H
#ifdef __cplusplus
#include "Utility/dsp.h"
namespace daisysp
{
class Comb
{
public:
Comb() {}
~Comb() {}
void Init(float sample_rate, float* buff, size_t size);
float Process(float in);
void SetPeriod(float looptime);
inline void SetFreq(float freq)
{
if(freq > 0)
{
SetPeriod(1.f / freq);
}
}
inline void SetRevTime(float revtime) { rev_time_ = revtime; }
private:
float sample_rate_, rev_time_, loop_time_, prvt_, coef_, max_loop_time_;
float* buf_;
size_t buf_pos_, mod_, max_size_;
};
} // namespace daisysp
#endif
#endif