osci-render/Source/audio/SmoothEffect.cpp

17 wiersze
467 B
C++
Czysty Zwykły widok Historia

2023-03-28 14:52:51 +00:00
#include "SmoothEffect.h"
SmoothEffect::SmoothEffect() {}
2023-03-28 14:52:51 +00:00
SmoothEffect::~SmoothEffect() {}
2024-01-07 16:17:20 +00:00
Point SmoothEffect::apply(int index, Point input, const std::vector<double>& values, double sampleRate) {
double weight = values[0];
weight *= 0.95;
double strength = 10;
weight = std::log(strength * weight + 1) / std::log(strength + 1);
// TODO: This doesn't consider the sample rate!
avg = weight * avg + (1 - weight) * input;
return avg;
2023-03-28 14:52:51 +00:00
}