summaryrefslogtreecommitdiff
path: root/instrument.h
diff options
context:
space:
mode:
Diffstat (limited to 'instrument.h')
-rw-r--r--instrument.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/instrument.h b/instrument.h
new file mode 100644
index 0000000..0ab12c9
--- /dev/null
+++ b/instrument.h
@@ -0,0 +1,33 @@
+#ifndef INSTRUMENT_H
+#define INSTRUMENT_H
+#include "util.h"
+
+struct Instrument_s;
+
+typedef struct Instrument_s Instrument;
+
+typedef WaveFrag (*sound_t)(void *, Volume v, Hertz h, Seconds s);
+typedef WaveFrag (*merger_t)(void *, WaveFrag *, LENT, int);
+
+WaveFrag make_sound(Instrument * in, Volume v, Hertz h, Seconds s);
+
+WaveFrag piano_sound(void * in, Volume v, Hertz h, Seconds s);
+
+/* Need this so that we can let instruments control reverberation,
+ say. */
+
+U_ATTR WaveFrag merge_waves(Instrument *in, WaveFrag *frags, LENT len, int step);
+
+/* Various instruments */
+
+Instrument *make_piano();
+
+void destroy_piano(Instrument *in);
+
+/* Violin */
+
+Instrument * make_violin();
+
+void destroy_violin(Instrument *in);
+
+#endif