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

Dependencies:   ClockControl PowerControl mbed

Committer:
kayekss
Date:
Tue Dec 23 21:50:53 2014 +0000
Revision:
6:cda45a5e723e
Parent:
3:cf57d7031c12
Supports "Panic on offline" feature when using MIDI-port input

Who changed what in which revision?

UserRevisionLine numberNew 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 3:cf57d7031c12 15 uint16_t samplingRate;
kayekss 3:cf57d7031c12 16
kayekss 0:727737138ac5 17 public:
kayekss 3:cf57d7031c12 18 GeminiCore(uint8_t, uint16_t);
kayekss 0:727737138ac5 19 ~GeminiCore();
kayekss 2:ca10e33bde0a 20 uint16_t makeSample(note_t*);
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