--- title: "Piano" type: "article" slug: "piano-3" url: "http://localhost/article/piano-3/" markdown_url: "http://localhost/article/piano-3.md" published_at: "2026-11-25T23:10:19+00:00" modified_at: "2026-11-27T10:36:06+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Our 2068 program comes this time comes from the book THE TIMEX SINCLAIR 2068 by Roger Valentine. 10 LET n$=\"q2w3er5t6y7ui9o0p\" 20 DIM a(256) 30 FOR j=1 TO 17:LET a(CODE n$(j)+1=j 40 NEXT j 50 LET i=CODE INKEY$+1 60 IF a(i) THEN BEEP .5,a(i)-1 70 GO TO 50 9000 SAVE \"PIANO\" LINE 0 This short program…" post_tag: - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Roger Valentine" slug: "roger-valentine" taxonomy: "indiv" url: "http://localhost/indiv/roger-valentine/" genre: - name: "Music" slug: "music" taxonomy: "genre" url: "http://localhost/type/music/" publication_r: id: 21216 title: "The Plotter" type: "periodical" url: "http://localhost/periodical/the-plotter/" authors: "Roger Valentine" volume: "2" issue: "4" issues_articles: - id: 39414 title: "The Plotter v2 n4" type: "issue" url: "http://localhost/issue/the-plotter-v2-n4/" pages: "2" pubdate: "April 1984" archive_link: false --- # Piano Our 2068 program comes this time comes from the book [THE TIMEX SINCLAIR 2068](http://localhost/book/the-timex-sinclair-2068-what-can-you-do-with-it/) by [Roger Valentine](http://localhost/indiv/roger-valentine/). ``` 10 LET n$="q2w3er5t6y7ui9o0p" 20 DIM a(256) 30 FOR j=1 TO 17:LET a(CODE n$(j)+1=j 40 NEXT j 50 LET i=CODE INKEY$+1 60 IF a(i) THEN BEEP .5,a(i)-1 70 GO TO 50 9000 SAVE "PIANO" LINE 0 ``` This short program redefines the top row of letter keys (QWERTYUIOP) to be the white keys of a piano and the proper number keys above them to be the black piano keys. The letter “E” produces the note E. Q will produce C. The number 4 is not used. LINE NOTES: ``` 10 Sets up the new array that changes the pitch of the BEEP. 30+50 Adjusr by +1 and -1 to 60 compensate for the fact that the character code starts at 0 and our array starts at 1. 60 Also rejects any keypress which has no redefined value, and produces a 1/2 second VEEP for the piano keys. ```