Spectral Piano

Date: 198x
Type: Program
Platform(s): TS 2068

Computer version of a piano.

Appears on


Source Code

   10 GO SUB 590
   20 FOR c=144 TO 151
   30 FOR n=0 TO 7
   40 READ a: POKE USR CHR$ c+n,a
   50 NEXT n: NEXT c
   60 DATA 15,15,15,15,15,15,7,0
   70 DATA 240,240,240,240,240,240,224,128
   80 DATA 15,15,15,15,7,0,0,0
   90 DATA 240,240,240,240,224,128,128,128
  100 DATA 128,128,128,128,128,255,128,128
  110 DATA 0,0,0,0,0,255,0,0
  120 DATA 128,128,255,128,128,128,128,128
  130 DATA 0,0,255,0,0,0,0,0
  140 PAPER 2: BORDER 0: CLS 
  150 REM Varaibles
  160 LET a$="middle"
  170 LET len=.3
  180 LET o=0
  190 REM Keyboard
  200 PAPER 7
  210 FOR n=8 TO 21: FOR m=7 TO 14
  220 PRINT AT m,n;" "
  230 NEXT m: NEXT n
  240 INK 0: PLOT 64,61: DRAW 111,0
  250 FOR n=64 TO 162 STEP 16: PLOT n,56: DRAW 0,63: NEXT n
  260 FOR n=9 TO 20 STEP 2: FOR m=7 TO 10
  270 IF n=13 THEN NEXT n
  280 PRINT AT m,n;"\ :\: "
  290 NEXT m: PRINT AT m,n;"\c\d"
  300 NEXT n
  310 REM Notes
  320 IF INKEY$="i" THEN LET o=-12: LET a$="bottom"
  330 IF INKEY$="o" THEN LET o=0: LET a$="middle"
  340 IF INKEY$="p" THEN LET o=12: LET a$="   top"
  350 IF INKEY$="1" THEN LET len=.1
  360 IF INKEY$="2" THEN LET len=.2
  370 IF INKEY$="3" THEN LET len=.3
  380 IF INKEY$="4" THEN LET len=.4
  390 IF INKEY$="5" THEN LET len=.5
  400 IF INKEY$="6" THEN LET len=.6
  410 IF INKEY$="7" THEN LET len=.7
  420 IF INKEY$="8" THEN LET len=.8
  430 IF INKEY$="9" THEN LET len=.9
  440 INK 7: PAPER 2: PRINT AT 0,20;"Lenght ";len;"  "
  450 PRINT AT 16,9;"^";AT 17,7;a$;" C"
  460 INK 0: PAPER 7: IF INKEY$="a" THEN PRINT AT 14,8;"\e\f": BEEP len,0+o: PRINT AT 14,8;"\g\h"
  470 IF INKEY$="w" THEN PRINT AT 11,9;"\a\b": BEEP len,1+o: PRINT AT 11,9;"\c\d"
  480 IF INKEY$="s" THEN PRINT AT 14,10;"\e\f": BEEP len,2+o: PRINT AT 14,10;"\g\h"
  490 IF INKEY$="e" THEN PRINT AT 11,11;"\a\b": BEEP len,3+o: PRINT AT 11,11;"\c\d"
  500 IF INKEY$="d" THEN PRINT AT 14,12;"\e\f": BEEP len,4+o: PRINT AT 14,12;"\g\h"
  510 IF INKEY$="f" THEN PRINT AT 14,14;"\e\f": BEEP len,5+o: PRINT AT 14,14;"\g\h"
  520 IF INKEY$="t" THEN PRINT AT 11,15;"\a\b": BEEP len,6+o: PRINT AT 11,15;"\c\d"
  530 IF INKEY$="g" THEN PRINT AT 14,16;"\e\f": BEEP len,7+o: PRINT AT 14,16;"\g\h"
  540 IF INKEY$="y" THEN PRINT AT 11,17;"\a\b": BEEP len,8+o: PRINT AT 11,17;"\c\d"
  550 IF INKEY$="h" THEN PRINT AT 14,18;"\e\f": BEEP len,9+o: PRINT AT 14,18;"\g\h"
  560 IF INKEY$="u" THEN PRINT AT 11,19;"\a\b": BEEP len,10+o: PRINT AT 11,19;"\c\d"
  570 IF INKEY$="j" THEN PRINT AT 14,20;"\e\f": BEEP len,11+o: PRINT AT 14,20;"\g\h"
  580 GO TO 310
  590 PAPER 2: CLS : PRINT INK 7;AT 0,7;"Spectral Piano"; OVER 1; INK 7;AT 0,7;"______________"
  600 LET n$="ASDFGHJ"
  610 LET l=1: FOR n=7 TO 20 STEP 2: PRINT PAPER 7; INK 0;AT 10,n;n$(l): LET l=l+1: NEXT n
  620 LET n$="WETYU"
  630 LET l=1: FOR n=8 TO 18 STEP 2: IF n=12 THEN NEXT n
  640 PRINT PAPER 0; INK 7;AT 8,n;n$(l): LET l=l+1: NEXT n
  650 PRINT AT 6,0;"USE THESE KEYS";AT 11,7;"^";AT 12,3;"MIDDLE C"
  660 PRINT AT 4,20;"octave keys": PRINT AT 6,22;"I  O  P"
  670 PRINT AT 2,2;"Lenght of note in fractions";AT 3,4;"of a second";AT 4,1;" 1,2,3,4,5,6,7,8,9"
  680 PRINT INK 7;AT 14,0;"Spectral Piano is a computer    version of a piano.Once you knowhow it works you will soon be   trying to play your own tunes."
  690 INPUT "When ready press enter";z$
  700 PRINT OVER 1; PAPER 7;AT 12,3;"        "; OVER 0; PAPER 2; INK 7;AT 14,0;"The keyboard is set out like    that of a real piano.By pressingthe keys A to J (on the second  row up)you will get a note from middle C to B.To obtain the     sharps and flats press any of   the keys displayed in white on  black."
  710 INPUT "press enter when ready";z$
  720 PRINT INK 7;AT 13,0;"S.p also has a function to alterthe octave you are playing in,  and a function to change the    lenght of a note. 1-If at any   time during playing you wish to change octaves just press key I to get the octave starting at   bottom C,key O to get the middle C octave and P to get the top C octave"
  730 INPUT "Press enter when ready";z$
  740 PRINT INK 7;AT 9,0;"2.-if at any time during playing you wish to change the duration of the notes you are pressing   press any key from 1 to 9.The   higher the number the longer    the note          "
  750 FOR n=15 TO 21: PRINT AT n,0,,: NEXT n: REM 32
  760 INPUT "Have you understood?(y/n)";z$: IF z$<>"y" THEN GO TO 590
  770 RETURN 
  780 PAUSE 0
  790 PAPER 7: INK 0: BORDER 7: FLASH 0: CLS 
  800 STOP 
  820 VERIFY ""


No people associated with this content.

Scroll to Top