summaryrefslogtreecommitdiffstats
path: root/src/synth_engine.h
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2023-07-07 01:09:12 +0300
committergramanas <anastasis.gramm2@gmail.com>2023-07-07 01:09:12 +0300
commitc8cd7f9298de876f2046fddd2e322a63c421a505 (patch)
tree1b764fed928592f8f3465e9ef28552b451efad8a /src/synth_engine.h
parentf170fb058a07175e6e753f2a6d20283dc7200a88 (diff)
downloadsynth-project-c8cd7f9298de876f2046fddd2e322a63c421a505.tar.gz
synth-project-c8cd7f9298de876f2046fddd2e322a63c421a505.tar.bz2
synth-project-c8cd7f9298de876f2046fddd2e322a63c421a505.zip
suppa
Diffstat (limited to 'src/synth_engine.h')
-rw-r--r--src/synth_engine.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/synth_engine.h b/src/synth_engine.h
index a1f3d4a..38ff740 100644
--- a/src/synth_engine.h
+++ b/src/synth_engine.h
@@ -6,21 +6,12 @@
#include <math.h>
#include <portaudio.h>
+#include "synth_common.h"
#include "notes.h"
#include "filter.h"
#include "adsr.h"
#include "control.h"
-//#define SAMPLE_RATE (44100)
-#define SAMPLE_RATE (48000)
-#define FRAMES_PER_BUFFER (256)
-
-#define VIZ_BUF 1024
-
-#define WIDTH 1024
-#define HEIGHT 600
-
-#define MIDI_NOTES 128
#ifndef M_PI
#define M_PI (3.14159265)
@@ -38,8 +29,10 @@ typedef struct midi_note_t {
PaTime noteOn;
PaTime noteOff;
float velocity; // normalized
- size_t wvt_index;
+ float wvt_index;
+ float lfo_index;
unsigned long long elapsed;
+ unsigned long long noteOffSample;
adsr_t * adsr;
int active;
} midi_note_t;
@@ -60,6 +53,7 @@ typedef struct {
cc_t cc_cutoff;
cc_t cc_resonance;
cc_t cc_lfo_freq;
+ cc_t cc_lfo_amp;
float freq_offset;
float gain;
@@ -81,7 +75,7 @@ typedef struct {
int modifiers[16];
int modi;
- float (*gen[4]) (float freq, midi_note_t * midi_note, float x, unsigned int sample_rate);
+ float (*gen[7]) (float freq, midi_note_t * midi_note, float x, unsigned int sample_rate);
int geni;
float cutoff;