Audio FX
 
Loading...
Searching...
No Matches
autotune.h
1#ifndef AUTOTUNE_H
2#define AUTOTUNE_H
3#include <map>
4#include <vector>
5#include <thread>
6#include "utils.h"
7#include "params.h"
8#include "fft.h"
9#include "tempo.h"
10using namespace std;
11
12
19{
20private:
21 vector<double> scaleNotes;
22 static map<char, vector<int>> intervals;
23 static map<string, double> rootNotes;
24 int sampleRate;
25
26
34 void tuneSlice(vector<double> slice, int start, vector<double>& out);
35
36
43 void tuneChannel(const vector<double>& channel, vector<double>&out);
44
51 double findShiftingFactor(double f);
52
53
54public:
55 double intensity;
56 string note;
57 char scale; // Major (M) or minor (m)
58
64 Autotune(double intensity, string note, char scale);
65
73 vector<vector<double>> process(const vector<vector<double>>& samples, int sampleRate);
74
79};
80
81#endif
Autotune(double intensity, string note, char scale)
void fillNoteTable()
note table depending on the musical scale used
vector< vector< double > > process(const vector< vector< double > > &samples, int sampleRate)
Use overlapping window approach to tune each audio frame to the nearest correct pitch on the provided...