12-polyphonic "chiptune" MIDI synthesizer for LPC1768 (Standalone version)
Dependencies: ClockControl PowerControl mbed
GeminiCore.h@0:727737138ac5, 2014-11-09 (annotated)
- Committer:
- kayekss
- Date:
- Sun Nov 09 08:00:33 2014 +0000
- Revision:
- 0:727737138ac5
- Child:
- 2:ca10e33bde0a
12-polyphonic "chiptune" MIDI synthesizer for mbed LPC1768 (Standalone version)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kayekss | 0:727737138ac5 | 1 | #ifndef GEMINICORE_H_ |
kayekss | 0:727737138ac5 | 2 | #define GEMINICORE_H_ |
kayekss | 0:727737138ac5 | 3 | |
kayekss | 0:727737138ac5 | 4 | #include <stdint.h> |
kayekss | 0:727737138ac5 | 5 | #include "Instrument.h" |
kayekss | 0:727737138ac5 | 6 | |
kayekss | 0:727737138ac5 | 7 | class GeminiCore { |
kayekss | 0:727737138ac5 | 8 | private: |
kayekss | 0:727737138ac5 | 9 | Instrument* instrumentList; |
kayekss | 0:727737138ac5 | 10 | uint8_t numInstruments; |
kayekss | 0:727737138ac5 | 11 | uint8_t* prevSample; // previous sample value (used for noise samples) |
kayekss | 0:727737138ac5 | 12 | uint8_t x8; // 8-bit random seed |
kayekss | 0:727737138ac5 | 13 | uint16_t x16; // 16-bit random seed |
kayekss | 0:727737138ac5 | 14 | |
kayekss | 0:727737138ac5 | 15 | public: |
kayekss | 0:727737138ac5 | 16 | static uint16_t const samplingRate; |
kayekss | 0:727737138ac5 | 17 | |
kayekss | 0:727737138ac5 | 18 | GeminiCore(uint8_t); |
kayekss | 0:727737138ac5 | 19 | ~GeminiCore(); |
kayekss | 0:727737138ac5 | 20 | uint16_t makeSample(); |
kayekss | 0:727737138ac5 | 21 | bool enable(uint8_t); |
kayekss | 0:727737138ac5 | 22 | bool disable(uint8_t); |
kayekss | 0:727737138ac5 | 23 | bool noteOn(uint8_t, uint16_t, uint8_t); |
kayekss | 0:727737138ac5 | 24 | bool noteOff(uint8_t); |
kayekss | 0:727737138ac5 | 25 | bool volume(uint8_t, uint8_t); |
kayekss | 0:727737138ac5 | 26 | bool expression(uint8_t, uint8_t); |
kayekss | 0:727737138ac5 | 27 | bool pitchBend(uint8_t, int16_t); |
kayekss | 0:727737138ac5 | 28 | bool setWave(uint8_t, Wavetable::wave_t); |
kayekss | 0:727737138ac5 | 29 | |
kayekss | 0:727737138ac5 | 30 | Instrument* getInstrumentList(); |
kayekss | 0:727737138ac5 | 31 | uint32_t getPlaybackStartTime(); |
kayekss | 0:727737138ac5 | 32 | |
kayekss | 0:727737138ac5 | 33 | private: |
kayekss | 0:727737138ac5 | 34 | uint8_t rand8(); |
kayekss | 0:727737138ac5 | 35 | uint16_t rand16(); |
kayekss | 0:727737138ac5 | 36 | }; |
kayekss | 0:727737138ac5 | 37 | |
kayekss | 0:727737138ac5 | 38 | #endif |