home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1985 April / Ahoy_Magazine_85-04_1985_Double_L.d64 / pachelbel (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1985-01-01  |  2.4 KB  |  102 lines

  1. 10 rem**read base freqs**
  2. 12 dimf(11):fori=0to11:readf(i):next
  3. 14 rem**read title & variables**
  4. 16 readz$,qm,qn,p1,p2:p3=p1-p2:ifp3<1thenp3=1
  5. 18 dimb(qm):b=49152:fori=0toqm:b(i)=b+qn*i*2:next:gosub182
  6. 20 rem**read & compile melodies**
  7. 22 a=b(1):fori=1toqm:forj=0toqn-1:readn$
  8. 24 a$=left$(n$,1):ifa$="0"thenl=0:goto44
  9. 28 n=(asc(a$)-67)*2:n=n+(n>4)-(n<0)*13
  10. 30 b$=mid$(n$,2,1)
  11. 32 ifb$="+"thenn=n+1
  12. 34 ifb$="-"thenn=n-1
  13. 36 oc=val(right$(n$,1))
  14. 38 f=f(n)/(2^(7-oc))
  15. 40 h=int(f/256):l=int(f-h*256)
  16. 42 pokea+1,h
  17. 44 pokea,l:a=a+2:next:next
  18. 46 rem**set melody #0**
  19. 48 fori=btob(1)-1:pokei,0:next
  20. 50 rem**set sid addresses**
  21. 52 sid=54272:fori=0to2:a=sid+i*7
  22. 54 x(i)=a:y(i)=a+1:z(i)=a+4:next
  23. 56 gosub152:pokesid+24,15
  24. 60 rem**read instruments**
  25. 62 fori=0to2:readw$,a,d,s,r,pf
  26. 64 w(i)=-(w$="t")*17-(w$="s")*33-(w$="p")*65-(w$="n")*129
  27. 66 pokex(i)+5,a*16+d:pokex(i)+6,s*16+r
  28. 68 ph=int(pf/256):pokex(i)+3,ph:pokex(i)+2,pf-ph*256:next
  29. 100 rem**play tune**
  30. 102 t=ti
  31. 104 fori=0to2:readm:ifm=-1then142
  32. 106 printm,:a(i)=b(m):next
  33. 108 fori=0toqn-1
  34. 110 t=t+p2
  35. 112 ift>tithen112
  36. 114 forj=0to2:l(j)=peek(a(j)):h(j)=peek(a(j)+1)
  37. 116 pokez(j),w(j)-1:a(j)=a(j)+2:next
  38. 118 t=t+p3
  39. 120 ift>tithen120
  40. 122 forj=0to2:ifl(j)=0then126
  41. 124 pokex(j),l(j):pokey(j),h(j):pokez(j),w(j)
  42. 126 next:next:printchr$(145):goto104
  43. 140 rem**end**
  44. 142 printchr$(147):gosub152:end
  45. 150 rem**sub:clear sound chip**
  46. 152 fori=sidtosid+28:pokei,0:next:return
  47. 180 rem**sub:display title**
  48. 182 printchr$(147)chr$(159)
  49. 184 print"the sidney chipp orchestra plays---":print:print
  50. 186 printchr$(18)z$:print:print:return
  51. 200 rem**freq data**
  52. 202 data34334,36376,38539,40830,43258,45830,48556,51443,54502,57743,61176,64814
  53. 300 rem**title**
  54. 302 datapachelbel's canon
  55. 310 rem**no.of melodies,notes per melody**
  56. 312 data7,32
  57. 320 rem**note duration,gate duration**
  58. 322 data16,4
  59. 400 rem **melody data**
  60. 410 rem #1
  61. 412 datac3,0,0,0,g2,0,0,0,a2,0,0,0,e2,0,0,0
  62. 414 dataf2,0,0,0,c2,0,0,0,f2,0,0,0,g2,0,0,0
  63. 420 rem #2
  64. 422 datae6,0,0,0,d6,0,0,0,c6,0,0,0,b5,0,0,0
  65. 424 dataa5,0,0,0,g5,0,0,0,a5,0,0,0,b5,0,0,0
  66. 430 rem #3
  67. 432 datac5,0,e5,0,g5,0,f5,0,e5,0,c5,0,e5,0,d5,0
  68. 434 datac5,0,a4,0,c5,0,g4,0,c5,0,a4,0,c5,0,d5,0
  69. 440 rem #4
  70. 442 datac5,b4,c5,0,g4,0,b4,0,c5,0,e5,0,g5,0,a5,0
  71. 444 dataf5,e5,d5,f5,e5,d5,c5,e5,d5,0,a4,0,c5,0,b4,0
  72. 450 rem #5
  73. 452 datac5,0,0,e5,e5,f5,e5,d5,c5,0,0,c6,c6,d6,c6,b5
  74. 454 dataa5,b5,c5,0,g5,0,c6,0,a5,0,c6,0,c6,0,b5,0
  75. 460 rem #6
  76. 462 datac3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  77. 464 datac3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  78. 470 rem #7
  79. 472 datac5,0,0,0,a5,0,g5,0,g5,0,f5,0,f5,0,e5,0
  80. 474 datae5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  81. 600 rem**instrument data**
  82. 602 data p,0,0,15,15,4000
  83. 604 data p,4,5,13,14,3700
  84. 606 data p,1,6,10,11,3400
  85. 700 rem**plan**
  86. 702 data1,0,0
  87. 704 data1,2,0
  88. 706 data1,2,3
  89. 708 data1,2,4
  90. 710 data1,3,4
  91. 712 data1,2,5
  92. 714 data1,3,5
  93. 716 data1,4,5
  94. 718 data0,2,3
  95. 720 data0,4,5
  96. 722 data4,2,3
  97. 724 data5,4,3
  98. 726 data1,3,4
  99. 728 data1,4,5
  100. 730 data6,7,7
  101. 732 data-1
  102.