output of below program is:
min: -0.625428, max: 1.02889
is there a way to normalize this output to [-1.0 : 1.0] ?
#include "Gamma/Domain.h"
#include "Gamma/Oscillator.h"
#include <cfloat>
#include <iostream>
using namespace std;
int main()
{
gam::Domain::master().spu(44100.0f);
gam::Saw<> saw;
saw.freq(440.0f);
float max_s = -FLT_MAX;
float min_s = FLT_MAX;
for (int i = 0; i < 44100; i += 1)
{
float s = saw();
if (s > max_s) max_s = s;
if (s < min_s) min_s = s;
}
cout << "min: " << min_s << ", max: " << max_s << endl;
}
output of below program is:
min: -0.625428, max: 1.02889is there a way to normalize this output to [-1.0 : 1.0] ?