5#include "AudioLogger.h"
55 int16_t
clip(int32_t in, int16_t clipLimit = 32767,
56 int16_t resultLimit = 32767) {
58 if (result > clipLimit) {
61 if (result < -clipLimit) {
62 result = -resultLimit;
85 if (!
active())
return input;
86 int32_t result =
volume() * input;
120 if (!
active())
return input;
159 if (!
active())
return input;
161 int32_t result =
clip(v * input);
207 if (!
active())
return input;
211 float signal_depth = (100.0 -
p_percent) / 100.0;
214 int32_t out = (signal_depth * input) + (tremolo_factor *
count * input);
220 }
else if (
count <= 0) {
250 float feedbackAmount = 1.0, uint32_t
sampleRate = 44100) {
295 if (!
active())
return input;
301 int32_t out = ((1.0f -
depth) * input) + (
depth * delayed_value);
305 float write_val = (float)input +
feedback * (
float)delayed_value;
307 int32_t write_int = (int32_t)roundf(write_val);
357 float release = 0.005,
float boostFactor = 1.0) {
358 this->
factor = boostFactor;
391 if (!
active())
return input;
415 PitchShift(
float shift_value = 1.0,
int buffer_size = 1000) {
437 if (!
active())
return input;
466 Compressor(uint32_t sampleRate = 44100, uint16_t attackMs = 30,
467 uint16_t releaseMs = 20, uint16_t holdMs = 10,
468 uint8_t thresholdPercent = 10,
float compressionRatio = 0.5) {
480 0.01f * thresholdPercent * NumberConverter::maxValueT<effect_t>();
509 0.01f * thresholdPercent * NumberConverter::maxValueT<effect_t>();
514 if (compressionRatio < 1.0f) {
522 if (!
active())
return input;
599 float outSampleF =
gain * inSampleF;
long map(long x, long in_min, long in_max, long out_min, long out_max)
Maps input to output values.
Definition Arduino.h:182
#define LOGD(...)
Definition AudioLoggerIDF.h:27
Real-time pitch shifting audio effect implementation.