This project, Simon Says Play Piano, is a practice instrument designed to help upcoming musicians test their piano and music note-recognition skills. The player will utilize the instrument to listen to a series of notes that they must then repeat in the same sequence, some times the user will be asked to sing as well, simulating the experience of playing the piano and singing for an audience.
Upon being turned on the piano will play a random set of seven notes or intervals where the player can sing into the microphone. After the melody is played the player uses to microphone or keys to mimic the melody that was played. After seven inputs are received the piano will go through and indicate to the player whether each note needed to be higher, needed to be lower, or was correct. After the player gets all seven inputs correct, a successful jingle will play and the player is given a brand new random song. If at any point the player would like to reset what they've put in or listen to the original melody again, they need only toggle the on/off switch again.
Mechanically the piano functions by having two CPXs, one which works as the keyboard that takes in inputs and sends those inputs via infrared signals to the mic, and a second which takes in vocal inputs, plays and creates melodies, and also handles the storing and comparison of the player's inputs from the keyboard CPX. The keyboard CPX is connected via several wires to aluminum that functions as capacitive touch keys as well as an on-off switch. If the keyboard is flipped on, the key's inputs are allowed to be used as well as it sends an infrared signal telling the mic to turn on and function as well. Each key has a unique infrared code that allows the microphone CPX to distinguish what was pressed. Upon turning on the mic CPX will create an array of seven indexes with random values that correspond to each of the 8 possible inputs. A function plays the created array using the CPXs speaker. As the mic CPX receives inputs from the player, each input's value is added to a second array which after receiving seven inputs tests to see if each index of both the original melody's array and the player's array matches.
If the function finds the player input value is less than the original, a low-pitch sound effect is played, and vice versa, if it is more than a high-pitch sound effect, is played, with the vocal input counting as the highest value.
A counter is kept during comparison that is subtracted from for every mistake made, if the counter is unchanged by the end of the comparison loop then the success sound is played, the arrays are emptied, and a new melody is created in the melody array's place
Comments
Please log in or sign up to comment.