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

Dependencies:   mbed USBDevice PinDetect

Committer:
asuszek
Date:
Thu Apr 21 02:37:49 2016 +0000
Revision:
20:bf675ba2c454
Parent:
11:f65806ee5833
Hooked up LEDs to main

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 * Identifies what note was passed in and passes this information along to chooseLEDForNote.
ndelfino 8:deaedb59243e 9 * @param key The integer representation of the note
ndelfino 8:deaedb59243e 10 * @param type This integer determines whether the event coming in is an "on" or "off" event
ndelfino 8:deaedb59243e 11 */
ndelfino 8:deaedb59243e 12 void identifyKeyForLed(int key, int type);
ndelfino 8:deaedb59243e 13
ndelfino 8:deaedb59243e 14 private:
ndelfino 8:deaedb59243e 15 /*
ndelfino 8:deaedb59243e 16 * Finds an available LED to light up or turn off depending on the type param.
ndelfino 8:deaedb59243e 17 * @param key[] This is the notes information such as the numerical key value and RGB values.
ndelfino 8:deaedb59243e 18 * @param type This integer determines whether the event coming in is an "on" or "off" event.
ndelfino 8:deaedb59243e 19 * @param signature Determines whether the note is sharp or not
ndelfino 8:deaedb59243e 20 */
ndelfino 11:f65806ee5833 21 void chooseLedForKey(int colors[3], int type, int signature, int key);
ndelfino 8:deaedb59243e 22
ndelfino 8:deaedb59243e 23 /*
ndelfino 8:deaedb59243e 24 * Sets the chosen LED to the proper color of the note passed in.
ndelfino 8:deaedb59243e 25 * @param key[] This is the notes information such as the numerical key value and RGB values.
ndelfino 8:deaedb59243e 26 * @param type This integer determines whether the event coming in is an "on" or "off" event.
ndelfino 8:deaedb59243e 27 * @param signature Determines whether the note is sharp or not
ndelfino 8:deaedb59243e 28 * @param led Determines which LED to light up
ndelfino 8:deaedb59243e 29 */
ndelfino 11:f65806ee5833 30 void setLedToKey(int colors[3], int type, int signature, int led, int key);
ndelfino 8:deaedb59243e 31
ndelfino 8:deaedb59243e 32
ndelfino 8:deaedb59243e 33 };