can somebody explain me why the sound gets distorted?
Here's the code:
:..MUSIC INCLUDE //prgmMUSEINC
:Data(2100r,1990r,1870r,1770r,1670r,1580r,1490r,1400r,1320r,1250r,1180r,1110r,1050r,996r,940r,887r,837r,790r,746r,704r,665r,627r,592r,559r,527r,498r,470r,444r,419r,395r,373r,352r,332r,314r,296r,279r,264r,249r,235r,222r,209r,198r,186r,176r,166r,157r,148r,140r,132r,124r,117r,111r,105r,99r,93r,88r,83r,78r,74r,70r,66r,62r,59r,55r,52r,49r,47r,44r,42r,39r,37r,35r,33r,31r,29r,28r,26r,25r,23r,22r,21r,20r,19r,18r,17r,16r,15r,14r,13r,12r,11r,10r,10r,9r,9r,8r,8r,7r,7r)→GDB0
:0→oCN
:2→oCS
:4→oDN
:6→oDS
:8→oEN
:10→oFN
:12→oFS
:14→oGN
:16→oGS
:18→oAN
:20→oAS
:22→oBN
:Data(8192r,16384r,32796r,65535r)→GDB1
:0→oTS
:2→oSX
:4→oET
:6→oQR
:..ROUTINE //prgmMUSERT
:Lbl PM
:Freq({24*r2+r1+GDB0}r,{r3+GDB1}r
:Return
prgmYSPRITE1 and prgmYRPGSPR4 is a sprite and tilemap datas.
:.ASTEST
:prgmYSPRITE1
:prgmYRPGSPR4
:prgmMUSEINC
:Data(8,3,2,0,3,2,18,2,2,8,3,2,0,3,2,18,2,2,8,3,2,18,2,2,10,3,2,0,3,2,18,2,2,10,3,2,0,3,2,18,2,2,8,3,2,0,3,2,4,3,2,22,2,2,14,2,2,4,3,2,22,2,2,14,2,2,4,3,2,14,2,2,8,3,2,0,3,2,14,2,2,8,3,2,0,3,2,14,2,2,8,3,2,4,3,2)→Pic1M//Music Data
:32→T
:Data(0,0,9,10,0,9,10,0,9,10,0,0,0,0,5,5,10,4,4,9,5,5,0,0,0,0,5,5,5,5,5,5,5,5,0,0,0,0,5,5,5,5,5,5,5,5,0,7,0,0,0,0,0,0,0,0,0,0,0,0,25,25,25,25,25,0,0,25,25,25,25,25,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)→Str9//Tilemap Data
:ClrDraw
:0→C
:For(B,0,7 //Creates Tilemap and store into
:For(A,0,11 //L3
:{Str9+C}→D
:Pt-Off(8*A,8*B,8*D+Pic001
:C+1→C
:End:End
:Copy(L6,L3,768
:40→X→Y
:0→Z→P
:Repeat getKey(15) //Main Loop
:ClrDraw
:Copy(L3,L6,768
:Pt-Off(X,Y,8*P+Str100
:DispGraph
:If getKey(2)
:X-8→X
:2→P
:End
:If getKey(3)
:X+8→X
:3→P
:End
:If getKey(1)
:Y+8→Y
:0→P
:End
:If getKey(4)
:Y-8→Y
:1→P
:End
:PM({3*Z+Pic1M},{3*Z+1+Pic1M},{3*Z+2+Pic1M} //This plays sound
:Z+1→Z
:Z=32?0→Z //Makes sound loop
:End
:prgmMUSERT
is it problem with getKey? is there a way to fix it?