portemento, adsr

This commit is contained in:
michalcourson
2025-10-25 14:49:02 -04:00
parent 7ba141daed
commit d68a6d5c2a
12 changed files with 2121 additions and 1460 deletions

View File

@ -2,6 +2,7 @@
#define SHIFTER_H
#include "Helmholtz.h"
#include "shifter_voice.h"
#define BUFFER_SIZE 8192
#define MAX_VOICES 12
@ -84,7 +85,7 @@ public:
void SetFormantPreserve(float val) { formant_preserve = val; }
void SetAutoTuneSpeed(float val) { out_period_filter_amount = 1 - val; }
int out_midi[MAX_VOICES + 1] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 };
int out_midi = -1;
private:
void DetectPitch(const float* const* in, float** out, size_t size);
@ -133,11 +134,12 @@ private:
int last_autotune_midi = -1;
float out_period_filter_amount = 0.7f; // You can expose this as a parameter
ShifterVoice voices[MAX_VOICES];
float out_periods[MAX_VOICES + 1] = { 0,0,0,0,0,0,0,0,0,0,0,0 }; //C3
float out_panning[MAX_VOICES + 1] = { 0,0,0,0,0,0,0,0,0,0,0,.5 }; //C3
float out_period = 0; //C3
float in_period = 366.936;
float out_period_counters[MAX_VOICES + 1] = { 0,0,0,0,0,0,0,0,0,0,0,0 };
float out_period_counter = 0;
float cos_lookup[8192];
};
#endif