The question is: how can you make a one key instrument that plays melodies you control? Here I use the time interval between presses to choose a note from a list. So press the space key to trigger notes. press faster to play higher notes. If you tap the same rhythm twice, you can get the same melody to play. The same rhythm a bit slower will shift the melody lower in pitch.
Gracias a @ericr por el trabajo original.