summaryrefslogtreecommitdiffstats
path: root/src/wavetable.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/wavetable.h
parentf170fb058a07175e6e753f2a6d20283dc7200a88 (diff)
downloadsynth-project-c8cd7f9298de876f2046fddd2e322a63c421a505.tar.gz
synth-project-c8cd7f9298de876f2046fddd2e322a63c421a505.tar.bz2
synth-project-c8cd7f9298de876f2046fddd2e322a63c421a505.zip
suppa
Diffstat (limited to 'src/wavetable.h')
-rw-r--r--src/wavetable.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/wavetable.h b/src/wavetable.h
new file mode 100644
index 0000000..46174b4
--- /dev/null
+++ b/src/wavetable.h
@@ -0,0 +1,24 @@
+#ifndef WAVETABLE_H
+#define WAVETABLE_H
+
+#include "synth_engine.h"
+
+#define WVT_MAX 44100
+
+typedef struct wave_t {
+ float * data;
+ size_t size;
+} wave_t;
+
+float wvt_sine(float *, float, int);
+float wvt_saw(float *, float, int);
+float wvt_digisaw(float *, float, int);
+float wvt_tri(float *, float, int);
+float wvt_sqr(float *, float, int);
+float wvt_sound(float *, float, int);
+
+float wvt_next(float (* wvt_fun)(float *, float, int), float freq, int sample_rate, float * wvt_index);
+
+void wvt_init();
+
+#endif /* WAVETABLE_H */