home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 3 #2 / Commodore_Disk_User_Vol.3_2_1989_-.d64 / demo4 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  1KB  |  42 lines

  1. 90 rem piano keyboard using musibasic
  2. 95 rem note the use of the new commands
  3. 100 print"[147]    [194]    [194]   [194]   "
  4. 110 print"    [194]    [194]   [194]   "
  5. 120 print"    [194]    [194]   [194]   "
  6. 130 print"  [194] [194] [194] [194] [194] [194] [194] [194] [194] [194] [194] [194] "
  7. 140 print" q[194]w[194]e[194]r[194]t[194]y[194]u[194]i[194]o[194]p[194]@[194]*[194]^"
  8. 150 print"'space' for solo or polyphonic"
  9. 160 print"'f1,f3,f5,f7' octave selection"
  10. 170 print"'f2,f4,f6,f8' waveform"
  11. 180 print"hang on, setting up frequency table..."
  12. 190 dim f(26):dim k(255)
  13. 200 (NULL)
  14. 210 f1=7040:fori=1to26:f(27-i)=f1*5.8+30:f1=f1/2^(1/12):next
  15. 220 k$="q2w3er5t6y7ui9o0p@-*\^"
  16. 230 fori=1tolen(k$):k(asc(mid$(k$,i)))=i:next
  17. 240 print"[145]                                       "
  18. 250 ad=0:sr=249:wv=16:w=0:m=1:oc=4:v=1
  19. 260 fori=1to3:(NULL) i,ad,sr
  20. 270 (NULL) i,2048:next
  21. 280 (NULL) 15
  22. 300 geta$:ifa$=""then300
  23. 310 fr=f(k(asc(a$)))/m:iffr=zthen:goto500
  24. 320 (NULL) v,z,z
  25. 330 (NULL) v,8:(NULL) v,0
  26. 340 (NULL) v,fr
  27. 360 (NULL) v,ad,sr
  28. 370 (NULL) v,wv+1
  29. 380 ifp=1then:v=v+1:ifv=4then:v=1
  30. 400 goto300
  31. 500 ifa$="[133]"then:m=1:oc=4:goto300
  32. 510 ifa$="[134]"then:m=2:oc=3:goto300
  33. 520 ifa$="[135]"then:m=4:oc=2:goto300
  34. 530 ifa$="[136]"then:m=8:oc=1:goto300
  35. 540 ifa$="[137]"then:w=0:wv=16:goto300
  36. 550 ifa$="[138]"then:w=1:wv=32:goto300
  37. 560 ifa$="[139]"then:w=2:wv=64:goto300
  38. 570 ifa$="[140]"then:w=3:wv=128:goto300
  39. 580 ifa$=" "then:p=1-p:(NULL) 2,0:(NULL) 3,0:goto300
  40. 590 ifa$="[147]"then200
  41. 600 goto300
  42.