diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2023-11-26 16:29:00 +0200 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2023-11-26 16:29:00 +0200 |
commit | 8d17aa29baf0b33229dbdd82d8d5f6cbe3fe0240 (patch) | |
tree | bc4ec3351f8585b548ddf016c93d3715b324b64c /src/synth_engine.h | |
parent | c03d395f6848fe9b2d1185173a9cf5ec8277394f (diff) | |
download | synth-project-8d17aa29baf0b33229dbdd82d8d5f6cbe3fe0240.tar.gz synth-project-8d17aa29baf0b33229dbdd82d8d5f6cbe3fe0240.tar.bz2 synth-project-8d17aa29baf0b33229dbdd82d8d5f6cbe3fe0240.zip |
Many changes!
Diffstat (limited to 'src/synth_engine.h')
-rw-r--r-- | src/synth_engine.h | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/src/synth_engine.h b/src/synth_engine.h index da15fe2..d01331f 100644 --- a/src/synth_engine.h +++ b/src/synth_engine.h @@ -12,12 +12,14 @@ #include "adsr.h" #include "control.h" #include "osc.h" - +#include "pa_ringbuffer.h" #ifndef M_PI #define M_PI (3.14159265) #endif +#define RING_SIZE 65536 + typedef struct lfo_t { float freq; float amp; @@ -38,11 +40,28 @@ typedef struct midi_note_t { int active; } midi_note_t; -typedef struct viz_t { - int sample_rate_divider; - float wave[VIZ_BUF]; - int wi; -} viz_t; +typedef struct { + int spectrum_enabled; + int wave_enabled; + int adsr_enabled; + int osc_enabled; + int freeze; + int rate_divider; + + float *wave_buffer_data; + PaUtilRingBuffer wave_buffer; + + float *fft_buffer_data; + PaUtilRingBuffer fft_buffer; + + float *tmp_buffer; + float *wave_viz_buffer; + float *fft_input_buffer; + float *fft_output_buffer; + float *fft_smooth_buffer; + + int tmp_index; +} synth_viz; typedef struct { PaStream *stream; @@ -55,12 +74,18 @@ typedef struct { cc_t cc_resonance; cc_t cc_lfo_freq; cc_t cc_lfo_amp; + cc_t cc_adsr_a; + cc_t cc_adsr_d; + cc_t cc_adsr_s; + cc_t cc_adsr_r; float gain; float x; midi_note_t midi_note[MIDI_NOTES]; + midi_note_t * midi_active[MIDI_NOTES]; + int midi_active_n; adsr_t adsr; @@ -89,9 +114,8 @@ typedef struct { int active; - viz_t viz; - viz_t fftviz; - + synth_viz viz; + osc_t * osctri; } synth_t; |