12-polyphonic "chiptune" MIDI synthesizer for LPC1768 (Standalone version)
Dependencies: ClockControl PowerControl mbed
GeminiCore.h@2:ca10e33bde0a, 2014-11-12 (annotated)
- Committer:
- kayekss
- Date:
- Wed Nov 12 23:46:31 2014 +0000
- Revision:
- 2:ca10e33bde0a
- Parent:
- 0:727737138ac5
- Child:
- 3:cf57d7031c12
GeminiCore: Deallocate finished notes at sampling
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 | 2:ca10e33bde0a | 5 | #include "note.h" |
kayekss | 0:727737138ac5 | 6 | #include "Instrument.h" |
kayekss | 0:727737138ac5 | 7 | |
kayekss | 0:727737138ac5 | 8 | class GeminiCore { |
kayekss | 0:727737138ac5 | 9 | private: |
kayekss | 0:727737138ac5 | 10 | Instrument* instrumentList; |
kayekss | 0:727737138ac5 | 11 | uint8_t numInstruments; |
kayekss | 0:727737138ac5 | 12 | uint8_t* prevSample; // previous sample value (used for noise samples) |
kayekss | 0:727737138ac5 | 13 | uint8_t x8; // 8-bit random seed |
kayekss | 0:727737138ac5 | 14 | uint16_t x16; // 16-bit random seed |
kayekss | 0:727737138ac5 | 15 | |
kayekss | 0:727737138ac5 | 16 | public: |
kayekss | 0:727737138ac5 | 17 | static uint16_t const samplingRate; |
kayekss | 0:727737138ac5 | 18 | |
kayekss | 0:727737138ac5 | 19 | GeminiCore(uint8_t); |
kayekss | 0:727737138ac5 | 20 | ~GeminiCore(); |
kayekss | 2:ca10e33bde0a | 21 | uint16_t makeSample(note_t*); |
kayekss | 0:727737138ac5 | 22 | bool enable(uint8_t); |
kayekss | 0:727737138ac5 | 23 | bool disable(uint8_t); |
kayekss | 0:727737138ac5 | 24 | bool noteOn(uint8_t, uint16_t, uint8_t); |
kayekss | 0:727737138ac5 | 25 | bool noteOff(uint8_t); |
kayekss | 0:727737138ac5 | 26 | bool volume(uint8_t, uint8_t); |
kayekss | 0:727737138ac5 | 27 | bool expression(uint8_t, uint8_t); |
kayekss | 0:727737138ac5 | 28 | bool pitchBend(uint8_t, int16_t); |
kayekss | 0:727737138ac5 | 29 | bool setWave(uint8_t, Wavetable::wave_t); |
kayekss | 0:727737138ac5 | 30 | |
kayekss | 0:727737138ac5 | 31 | Instrument* getInstrumentList(); |
kayekss | 0:727737138ac5 | 32 | uint32_t getPlaybackStartTime(); |
kayekss | 0:727737138ac5 | 33 | |
kayekss | 0:727737138ac5 | 34 | private: |
kayekss | 0:727737138ac5 | 35 | uint8_t rand8(); |
kayekss | 0:727737138ac5 | 36 | uint16_t rand16(); |
kayekss | 0:727737138ac5 | 37 | }; |
kayekss | 0:727737138ac5 | 38 | |
kayekss | 0:727737138ac5 | 39 | #endif |