diff options
author | JSDurand <mmemmew@gmail.com> | 2021-07-11 18:45:38 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2021-07-11 18:45:38 +0800 |
commit | 6c358a842baaf6d211a5c8c1717d815e7813ed96 (patch) | |
tree | c78122d49e75a540a4f6054b224a90738b554606 /instrument.h |
First commit
Now I have a kind of piano like instrument. A violin-like instrument
is being constructed.
Diffstat (limited to 'instrument.h')
-rw-r--r-- | instrument.h | 33 |
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 |