No need to shout 
First, I think you should put a RECORD button in your interface to notice the users when the application is recording their melodies. Once the record button is pressed you must set a variable with the current timestamp, then whenever a key of the virtual keyboard is pressed you must append the value of key and the time ( current timestamp - timestamp when the record button have been pressed ). Then when the user hits the PLAY button, you have to read the list of keys and timestamp differences to replay the notes.
