home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1986 May / 1986-05.d64 / read-a-tune (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  98 lines

  1. 10 print"[147]loading ml...":fori=1to255:a$=a$+" ":next:ns=125:dimm$(ns),n$(ns)
  2. 20 fori=49152to49290:reada:pokei,a:ck=ck+a:next:rem load key note player
  3. 30 ifck<>15135thenprint"error in data statements.":stop
  4. 40 data 162,49,160,234,173,97,192,73,1,141
  5. 50 data 97,192,240,4,162,27,160,192,120,142
  6. 60 data 20,3,140,21,3,88,96,164,197,185
  7. 70 data 129,235,56,233,65,48,27,201,15,176
  8. 80 data 23,168,169,64,141,4,212,185,67,192
  9. 90 data 190,82,192,141,1,212,142,0,212,169
  10. 100 data 65,141,4,212,76,49,234,28,31,16
  11. 110 data 18,21,22,25,33,37,42,44,50,12
  12. 120 data 14,15,49,165,195,209,31,96,30,135
  13. 130 data 162,62,193,60,143,24,210,0
  14. 140 data 32,253,174,32,139,176,160,1,177,71
  15. 150 data 133,2,200,177,71,133,3,162,1,32
  16. 160 data 198,255,160,0,32,207,255,145,2,201
  17. 170 data 46,240,4,200,76,122,192,200,132,4,96
  18. 180 fori=54272to54296:pokei,0:next:poke54275,5:poke54296,12
  19. 190 rl=54272:rh=54273:dimh(15),l(15):fori=1to15:readh(i),l(i):next:remnote data
  20. 200 data 28,49,31,165,16,195,18,209,21,31,22,96
  21. 210 data 25,30,33,135,37,162,42,62,44,193,50,60,12,143,14,24,15,210
  22. 220 poke53281,15:poke53280,4
  23. 230 ifenthenprint"[147]":close15:end
  24. 240 print"[147][144]    the 64 read-a-tune music system! [146]"
  25. 250 print,"1=write a song":print,"2=play back your song"
  26. 260 print,"3=recall your songs":print,"4=save your songs"
  27. 270 print,"5=12th street rag":print,"6=yankee doodle"
  28. 280 print,"7=some really fast scales!":print,"8=end of program"
  29. 290 print,"select one:"
  30. 300 d$="hbahbahbahbahbaahbahhahbaaereedrhbahbahbahbahbaahbahhahbaaeeffgg"
  31. 310 d$=d$+"hbahbahbahbahbaahbahhahbaaereedrffgaggababhihbaghhgaageecccrhhhr."
  32. 320 e$="hrhrirjrhrjrirgrhrhrirjrhhhhbbgghrhrirjrkrjrirhrbrgrarbrhhhrhhhr"
  33. 330 e$=e$+"aaabaaggaabbhhhrgggaggffeeffgggraaabaaggaabbhhaagghhbbiihhhrhhhr."
  34. 340 f$="hhhhgrgraaaaggggrrrrbbbbhhhhcccrr."
  35. 350 g$="mnocdefgabhijkllrrlkjihbagfedconmmrrcdefgabhbagfedccrrcdefgabhbagfedc."
  36. 360 getq$:ifq$=""then360
  37. 370 q=val(q$):onqgoto510,700,860,850,400,410,390,420
  38. 380 goto360
  39. 390 print"[147][144]       some really fast scales!":print""g$:sp=1:goto430
  40. 400 print"[147][144]"," twelfth street rag  ":print""d$:sp=9:goto430
  41. 410 print"[147][144]","   yankee doodle":print""e$:sp=28:goto430
  42. 420 print"[147]","  that's all![144]":print""f$:sp=4:en=1
  43. 430 x=0:poke54277,31:poke54276,64:poke54278,255
  44. 440 x=x+1:p=1094+x:pp=peek(p)
  45. 450 ifpp=18orpp=32thenpokerh,0:pokerl,0:goto490
  46. 460 ifpp=46thenpokerh,0:pokerl,0:poke54276,64:goto230
  47. 470 ifpp>15then440
  48. 480 poke54276,65:pokerh,h(pp):pokerl,l(pp)
  49. 490 fort=1tosp:next:pp=pp+128:pokep,pp:fort=1tosp:next
  50. 500 pp=pp-128:pokep,pp:goto440
  51. 510 n=n+1:ifn>nsthenprint"[147]too many tunes!":forde=1to1000:next:n=n-1:goto240
  52. 520 poke54277,25:poke54278,0
  53. 530 print"[147]so you're ready to write a song!"
  54. 540 print"[144]here are the notes:":print"m=low g   n=low a    o=low b"
  55. 550 print"c=mid c   d=mid d    e=mid e   f=mid f"
  56. 560 print"g=mid g   a=mid a    b=mid b   h=high c"
  57. 570 print"i=high d  j=high e   k=high f  l=high g":print"r=rest"
  58. 580 print"enter title of song #"n":[156]"
  59. 590 n$(n)="":inputn$(n):ifn$(n)=""thenprint"[145]";:goto590
  60. 600 n$(n)=left$(n$(n),20):print"ok, enter [156]"n$(n)":"
  61. 610 print:p=0:sys49152
  62. 620 gett$:ift$=""then620
  63. 630 ift$=chr$(13)then650
  64. 640 printt$;:p=p+1:ifp<254then620
  65. 650 p=0:sys49152
  66. 660 p=p+1:ifpeek(1703+p)<>32thenp$=p$+chr$(peek(1703+p)+64):goto660
  67. 670 ifp$=""thenn=n-1:goto240
  68. 680 print"[147]song #[144]"n"called [156]"n$(n)":":m$(n)=p$+".":print""m$(n):p$=""
  69. 690 sp=33:goto430
  70. 700 ifn=0then230
  71. 710 u=0:r=4:gosub810:fori=1ton:if(i-u*16+u)/16=int((i-u*16+u)/16)then730
  72. 720 printtab(5-len(str$(i)))"[144]"i"        [156]"n$(i):next
  73. 730 print"press m[146] for more":y$=">":gosub800
  74. 740 geta$:ifa$=""then740
  75. 750 ifa$=chr$(17)theny$=" ":gosub800:r=r-(r<>(i+2-u*15)):y$=">":gosub800
  76. 760 ifa$=chr$(145)theny$=" ":gosub800:r=r+(r<>4):y$=">":gosub800
  77. 770 ifa$=chr$(13)thensn=u*15+r-3:goto840
  78. 780 ifa$="m"andi<=nthenu=u+1:r=4:y$=">":gosub800:gosub810:goto720
  79. 790 goto740
  80. 800 poke214,r:print:print"[144] "y$:return
  81. 810 print"[147]locate arrow with cursor keys and"
  82. 820 print"press <return> to pick a tune.":print
  83. 830 printtab(2)"[144]song #"tab(15)"title":return
  84. 840 print"[147]a song called [156]"n$(sn)":":print""m$(sn):print"[144]":goto430
  85. 850 ifn=0then230
  86. 860 x$="":print"[147]enter filename: ";:inputx$:ifx$=""then240
  87. 870 x$="0:"+x$:ifq=4then910
  88. 880 open1,8,8,x$+",s,r":gosub950
  89. 890 input#1,n:fori=1ton:input#1,n$(i):next:fori=1ton
  90. 900 sys49250,a$:m$(i)=left$(a$,peek(4)):next:gosub950:close1:gosub950:goto240
  91. 910 close15:open15,8,15,"s"+x$:close15
  92. 920 o=0:open1,8,8,x$+",s,w":gosub950
  93. 930 print#1,n:fori=1ton:print#1,n$(i):next
  94. 940 fori=1ton:print#1,m$(i);:next:gosub950:close1:gosub950:goto240
  95. 950 ifo=0thenopen15,8,15:o=1
  96. 960 input#15,a,b$,c,d:ifathenprinta,b$,c,d:stop
  97. 970 return
  98.