summaryrefslogtreecommitdiffstats
path: root/src/synth_engine_v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth_engine_v2.c')
-rw-r--r--src/synth_engine_v2.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/synth_engine_v2.c b/src/synth_engine_v2.c
index 726839f..a3c6efa 100644
--- a/src/synth_engine_v2.c
+++ b/src/synth_engine_v2.c
@@ -331,9 +331,12 @@ m_init_synth(synth_t * synth)
}
-void
-init_synth(synth_t * synth)
+synth_t *
+init_synth(void)
{
+ synth_t * synth = (synth_t *)malloc(sizeof(synth_t));
+ if (!synth) return NULL;
+
synth->cci = 0;
CC(synth->cc_cutoff, "cutoff", 10, 22000, 30, 5000);
CC(synth->cc_resonance, "resonance", 1, 10, .02, 1);
@@ -379,7 +382,7 @@ init_synth(synth_t * synth)
synth->octave = 3;
synth->delay = 0;
- synth->del[SAMPLE_RATE * 10];
+ synth->del = (float *) calloc(sizeof(float), SAMPLE_RATE * 30);
synth->deli = 0;
synth->del_time = .1;
synth->del_feedback = 0.5f;
@@ -442,7 +445,9 @@ free_synth(synth_t * synth)
free(synth->viz.fft_output_buffer);
free(synth->viz.fft_smooth_buffer);
- //free(synth->ring_data);
free_bw_low_pass(synth->fff);
free_bw_band_stop(synth->fff2);
+
+ free(synth->del);
+ free(synth);
}