адаптация s13bby/osc под vst и gui. (вайбкод)
вайбкод потому что мне в моменте стало понятно. что проще было сразу писать на фреймворке JUCE, чем адаптировать консольное приложение на MiniAudio. обновляться данный репозиторий не будет. СmakeLists адаптирован онли под linux.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#ifndef FILTER
|
||||
#define FILTER
|
||||
|
||||
#include <cstdint>
|
||||
#include <cmath>
|
||||
#include <numbers>
|
||||
|
||||
#include "../include/command.hpp"
|
||||
|
||||
class Filter{
|
||||
public:
|
||||
Filter(){
|
||||
mode = CommandType::SetFilterOff;
|
||||
|
||||
cutoff = 1000.0;
|
||||
resonance = 0.707;
|
||||
frequency_coefficient = 0.0;
|
||||
low = 0.0;
|
||||
band = 0.0;
|
||||
high = 0.0;
|
||||
damping = 0.0;
|
||||
|
||||
sample_rate = 48000.0;
|
||||
update_coefficients();
|
||||
}
|
||||
|
||||
void set_sample_rate(double sample_rate_);
|
||||
void set_cutoff(double value);
|
||||
void set_resonance(double value);
|
||||
void set_filter_off();
|
||||
void set_low_pass_filter();
|
||||
void set_band_pass_filter();
|
||||
void set_high_pass_filter();
|
||||
void update_coefficients();
|
||||
|
||||
double process(double input);
|
||||
|
||||
private:
|
||||
double max_stable_cutoff() const;
|
||||
|
||||
CommandType mode;
|
||||
|
||||
double cutoff;
|
||||
double resonance;
|
||||
double frequency_coefficient;
|
||||
double low;
|
||||
double band;
|
||||
double high;
|
||||
double damping;
|
||||
|
||||
double sample_rate;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user