mirror of
https://codeberg.org/armin/horizont.git
synced 2026-09-01 04:10:46 +02:00
23 lines
400 B
C++
23 lines
400 B
C++
#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;
|
|
};
|