A MIDI piano synthesizer that implements the Karplus Strong physical modeling algorithm.

Dependencies:   mbed USBDevice PinDetect

Committer:
ndelfino
Date:
Thu Apr 14 03:00:08 2016 +0000
Revision:
11:f65806ee5833
Parent:
8:deaedb59243e
Child:
20:bf675ba2c454
I can handle any and all keys passed in. Anything. Try me bro.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ndelfino 8:deaedb59243e 1
ndelfino 8:deaedb59243e 2 #include "mbed.h"
ndelfino 8:deaedb59243e 3
ndelfino 8:deaedb59243e 4 class LEDController{
ndelfino 8:deaedb59243e 5 public:
ndelfino 8:deaedb59243e 6
ndelfino 8:deaedb59243e 7 /*
ndelfino 8:deaedb59243e 8 * Constructor
ndelfino 8:deaedb59243e 9 */
ndelfino 8:deaedb59243e 10 LEDController();
ndelfino 8:deaedb59243e 11
ndelfino 8:deaedb59243e 12 /*
ndelfino 8:deaedb59243e 13 * Identifies what note was passed in and passes this information along to chooseLEDForNote.
ndelfino 8:deaedb59243e 14 * @param key The integer representation of the note
ndelfino 8:deaedb59243e 15 * @param type This integer determines whether the event coming in is an "on" or "off" event
ndelfino 8:deaedb59243e 16 */
ndelfino 8:deaedb59243e 17 void identifyKeyForLed(int key, int type);
ndelfino 8:deaedb59243e 18
ndelfino 8:deaedb59243e 19 private:
ndelfino 8:deaedb59243e 20 /*
ndelfino 8:deaedb59243e 21 * Finds an available LED to light up or turn off depending on the type param.
ndelfino 8:deaedb59243e 22 * @param key[] This is the notes information such as the numerical key value and RGB values.
ndelfino 8:deaedb59243e 23 * @param type This integer determines whether the event coming in is an "on" or "off" event.
ndelfino 8:deaedb59243e 24 * @param signature Determines whether the note is sharp or not
ndelfino 8:deaedb59243e 25 */
ndelfino 11:f65806ee5833 26 void chooseLedForKey(int colors[3], int type, int signature, int key);
ndelfino 8:deaedb59243e 27
ndelfino 8:deaedb59243e 28 /*
ndelfino 8:deaedb59243e 29 * Sets the chosen LED to the proper color of the note passed in.
ndelfino 8:deaedb59243e 30 * @param key[] This is the notes information such as the numerical key value and RGB values.
ndelfino 8:deaedb59243e 31 * @param type This integer determines whether the event coming in is an "on" or "off" event.
ndelfino 8:deaedb59243e 32 * @param signature Determines whether the note is sharp or not
ndelfino 8:deaedb59243e 33 * @param led Determines which LED to light up
ndelfino 8:deaedb59243e 34 */
ndelfino 11:f65806ee5833 35 void setLedToKey(int colors[3], int type, int signature, int led, int key);
ndelfino 8:deaedb59243e 36
ndelfino 8:deaedb59243e 37
ndelfino 8:deaedb59243e 38 };