Today I was checking out my programs and found an old QBasic one from the 1990's of a piano I made that still used line numbers lol. QBasic used the old internal beep speaker so this didn't last too long. Later an old friend showed me how to use the Sound Blaster sound card with QBasic but that was tons of code way beyond me. So I am really happy that QB64 automatically uses the sound card for any sounds. So today I converted that old piano program into a QB64 and added more notes and the ability to change the note length using your up and down arrow keys. Everything is self-explanatory. I remember awhile back B+ said he didn't know about the PLAY command, so here it is B+, turned into a piano. There's no graphics on this program, you just press keyboard keys and it plays. Of course there's a limit on how fast the computer transmits to the sound card, so if you play kinda fast and stop, it will keep playing until all of your keys you typed are played out. Try going down to Note Length 2 and typing pretty fast, it's pretty cool! You might notice that instead of using the a,b,c,d,e,f note code, I am using the n21,n22,n23.... I did that to make it easier to expand past just the usual 7 notes.
_TITLE "My Piano by SierraKen" PRINT "To play press letters: q, w, e, r, t, y, u, i, o, p, [, ], \" PRINT "Press up and down arrow keys for higher or lower note length." PRINT "Press <Esc> to quit." l = 12
ll = 12
l = l + 1
ll = ll - 1
l = l - 1
ll = ll + 1
n$ = ""