horizont/Source/PitchShifter.h

23 lines
400 B
C
Raw Normal View History

2026-08-10 12:55:02 +02:00
#pragma once
#include <vector>
class PitchShifter
{
public:
void prepare (double sampleRate);
void reset();
float process (float input, float ratio);
private:
float at (int index) const;
float readCubic (float pos) const;
std::vector<float> buffer;
int bufferSize = 0;
int writePos = 0;
float o = 0.0f;
float baseDelay = 0.0f;
float window = 0.0f;
};