summaryrefslogtreecommitdiffstats
path: root/src/synth_engine.h
diff options
context:
space:
mode:
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;