Use an array to store the names of notes you want to store, for example:
C,C#,D,D#,E,F,F#,G,G#,A,A#,B
Load your audio samples for each note and name them the same as the values in the array.
Create keys sprites that match the notes in your array and give them an instance string variable called: var_note.
Create a static local or global variable called: var_currentnote
Create a text object to display the outcome.
Whenever you want the note to play use the logic below:
On play note action - Set var_currentnote to Array.At(choose(0,Array.Width-1))
Sub Event - Play audio by name var_currentnote
This will select a random note from those in your array and then play the correspondingly named audio file.
Once the sound has played the player should click on the appropriate note sprite on screen. When this happens use this logic:
On Mouse clicked on KeySprite
Sub Event
Evaluate expression: KeySprite.var_note=var_currentnote - Set text to "Correct"
Else - Set Text to "Wrong"