A MIDI piano synthesizer that implements the Karplus Strong physical modeling algorithm.
Dependencies: mbed USBDevice PinDetect
Diff: LEDController.h
- Revision:
- 8:deaedb59243e
- Child:
- 11:f65806ee5833
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LEDController.h Wed Apr 13 17:44:36 2016 +0000 @@ -0,0 +1,38 @@ + +#include "mbed.h" + +class LEDController{ +public: + + /* + * Constructor + */ + LEDController(); + + /* + * Identifies what note was passed in and passes this information along to chooseLEDForNote. + * @param key The integer representation of the note + * @param type This integer determines whether the event coming in is an "on" or "off" event + */ + void identifyKeyForLed(int key, int type); + +private: + /* + * Finds an available LED to light up or turn off depending on the type param. + * @param key[] This is the notes information such as the numerical key value and RGB values. + * @param type This integer determines whether the event coming in is an "on" or "off" event. + * @param signature Determines whether the note is sharp or not + */ + void chooseLedForKey(int key[4], int type, int signature); + + /* + * Sets the chosen LED to the proper color of the note passed in. + * @param key[] This is the notes information such as the numerical key value and RGB values. + * @param type This integer determines whether the event coming in is an "on" or "off" event. + * @param signature Determines whether the note is sharp or not + * @param led Determines which LED to light up + */ + void setLedToKey(int key[4], int type, int signature, int led); + + +}; \ No newline at end of file