A MIDI piano synthesizer that implements the Karplus Strong physical modeling algorithm.
Dependencies: mbed USBDevice PinDetect
LEDController.h
- Committer:
- ndelfino
- Date:
- 2016-04-13
- Revision:
- 8:deaedb59243e
- Child:
- 11:f65806ee5833
File content as of revision 8:deaedb59243e:
#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); };