12-polyphonic "chiptune" MIDI synthesizer for LPC1768 (Standalone version)

Dependencies:   ClockControl PowerControl mbed

Revision:
0:727737138ac5
Child:
2:ca10e33bde0a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GeminiCore.h	Sun Nov 09 08:00:33 2014 +0000
@@ -0,0 +1,38 @@
+#ifndef GEMINICORE_H_
+#define GEMINICORE_H_
+
+#include <stdint.h>
+#include "Instrument.h"
+
+class GeminiCore {
+private:
+    Instrument* instrumentList;
+    uint8_t     numInstruments;
+    uint8_t*    prevSample;      // previous sample value (used for noise samples)
+    uint8_t     x8;              // 8-bit random seed
+    uint16_t    x16;             // 16-bit random seed
+    
+public:
+    static uint16_t const samplingRate;
+    
+    GeminiCore(uint8_t);
+    ~GeminiCore();
+    uint16_t makeSample();
+    bool enable(uint8_t);
+    bool disable(uint8_t);
+    bool noteOn(uint8_t, uint16_t, uint8_t);
+    bool noteOff(uint8_t);
+    bool volume(uint8_t, uint8_t);
+    bool expression(uint8_t, uint8_t);
+    bool pitchBend(uint8_t, int16_t);
+    bool setWave(uint8_t, Wavetable::wave_t);
+    
+    Instrument* getInstrumentList();
+    uint32_t getPlaybackStartTime();
+
+private:
+    uint8_t rand8();
+    uint16_t rand16();
+};
+
+#endif