summaryrefslogtreecommitdiffstats
path: root/src/archive/wavetable.h
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2023-09-14 13:57:53 +0300
committergramanas <anastasis.gramm2@gmail.com>2023-09-14 13:57:53 +0300
commit12ef243815d409e5f4039502f378d43ecdf7abaa (patch)
treef591744328fffd4b8d5a573429e8d946d48f34b7 /src/archive/wavetable.h
parent21eecb756fc671b8cc6657f8b07a3affd38536db (diff)
downloadsynth-project-12ef243815d409e5f4039502f378d43ecdf7abaa.tar.gz
synth-project-12ef243815d409e5f4039502f378d43ecdf7abaa.tar.bz2
synth-project-12ef243815d409e5f4039502f378d43ecdf7abaa.zip
Add archive code
Diffstat (limited to 'src/archive/wavetable.h')
-rw-r--r--src/archive/wavetable.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/archive/wavetable.h b/src/archive/wavetable.h
new file mode 100644
index 0000000..46174b4
--- /dev/null
+++ b/src/archive/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 */