parent
a7ce35791f
commit
33b615261f
|
|
@ -27,7 +27,7 @@ sample_table_t gen_squ()
|
||||||
if (i < (DEFAULT_N_SAMPLES / 2)) {
|
if (i < (DEFAULT_N_SAMPLES / 2)) {
|
||||||
squ_vals[i] = 1;
|
squ_vals[i] = 1;
|
||||||
} else {
|
} else {
|
||||||
squ_vals[i] = 0;
|
squ_vals[i] = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,7 +38,7 @@ sample_table_t gen_saw()
|
||||||
{
|
{
|
||||||
sample_table_t saw_vals = {0};
|
sample_table_t saw_vals = {0};
|
||||||
float_t step = 2.0 / DEFAULT_N_SAMPLES; // calculate our incremental step size
|
float_t step = 2.0 / DEFAULT_N_SAMPLES; // calculate our incremental step size
|
||||||
float_t val = 0; // place to store calculate value
|
float_t val = -1; // place to store calculate value
|
||||||
|
|
||||||
// Start low go high [0, 1]
|
// Start low go high [0, 1]
|
||||||
for (uint16_t i = 0; i < DEFAULT_N_SAMPLES; i++) {
|
for (uint16_t i = 0; i < DEFAULT_N_SAMPLES; i++) {
|
||||||
|
|
@ -54,9 +54,9 @@ sample_table_t gen_tri()
|
||||||
sample_table_t tri_vals = {0};
|
sample_table_t tri_vals = {0};
|
||||||
uint16_t half_samples = DEFAULT_N_SAMPLES / 2;
|
uint16_t half_samples = DEFAULT_N_SAMPLES / 2;
|
||||||
float_t step = 2.0 / half_samples; // calculate our incremental step size
|
float_t step = 2.0 / half_samples; // calculate our incremental step size
|
||||||
float_t val = 0; // place to store calculate value
|
float_t val = -1; // place to store calculate value
|
||||||
|
|
||||||
// Start low go high then low [0, 1, 0]
|
// Start low go high then low [-1, 1, -1]
|
||||||
for (uint16_t i = 0; i < DEFAULT_N_SAMPLES; i++) {
|
for (uint16_t i = 0; i < DEFAULT_N_SAMPLES; i++) {
|
||||||
tri_vals[i] = val;
|
tri_vals[i] = val;
|
||||||
if (i < half_samples) {
|
if (i < half_samples) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue