home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 10 / 010.d81 / beats (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  1KB  |  35 lines

  1. 10 rem program name beats
  2. 20 rem demonstrates beat frequencies
  3. 30 rem with the sid chip
  4. 40 rem david r. brooks, july 1984
  5. 45 poke650,255:rem   repeat keys
  6. 50 print"[147]":print"press +[146] to widen interval"
  7. 60 print"press -[146] to narrow interval"
  8. 70 print"press f1[146] to raise cutoff freq"
  9. 80 print"press f3[146] to lower cutoff freq"
  10. 90 print"press return[146] to stop"
  11. 100 s=54272:rem sid reference location
  12. 110 forl=stos+24:pokel,0:next:rem clear sid
  13. 120 pokes+5,9:pokes+12,9:rem attack=0,decay=9
  14. 130 pokes+6,240:pokes+13,240:rem sustain=15,release=0
  15. 140 pokes+24,31:fl=158:rem volume=max, filter=lo pass, set initial cutoff
  16. 150 f1=int(261.63/.06097+.5):f2=int(392.00/.06097+.5):rem frequency pokes
  17. 160 h1=int(f1/256):h2=int(f2/256):rem hi register
  18. 170 l1=f1-h1*256:l2=f2-h2*256:rem lo register
  19. 180 pokes+1,h1:pokes,l1:rem poke frequency registers for voice 1
  20. 190 pokes+8,h2:pokes+7,l2:rem poke frequency registers for voice2
  21. 200 pokes+4,17:rem poke triangle waveform for voice 1
  22. 210 pokes+11,17:rem poke triangle waveform for voice 2
  23. 220 pokes+22,fl:pokes+21,0:pokes+23,3:rem poke cutoff freq, filter 1&2 on
  24. 230 poke198,0:wait198,1:getz$
  25. 240 ifz$=chr$(13)thenfori=stos+24:pokei,0:next:goto63000
  26. 245 rem +=43, -=45, 133=f1, 134=f3
  27. 250 ifz$=chr$(43)thenl2=l2+1:ifl2>255thenl2=255:goto190
  28. 260 ifz$=chr$(45)thenl2=l2-1:ifl2<0thenl2=0:goto190
  29. 270 ifz$=chr$(133)thenfl=fl+5:iffl>255thenfl=255:goto190
  30. 280 ifz$=chr$(134)thenfl=fl-5:iffl<0thenfl=0:goto190
  31. 300 goto190
  32. 63000 rem    return to loadstar
  33. 63010 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  34. 63020 poke631,13:poke632,13:poke198,2:end
  35.