dim musicPointer=a dim musicTimer=b dim beatPointer=c dim beatTimer=d rem VOLUME DOWN AND SET CHANNELS AUDV0=0 AUDC0=10 AUDV1=0 AUDC1=8 rem INITIALIZE POINTERS AND TIMERS musicPointer=0 musicTimer=0 beatPointer=0 beatTimer=0 startLoop rem TIME TO UPDATE NOTE? if musicTimer = 0 then gosub changeMusicNote musicTimer = musicTimer - 1 if beatTimer = 0 then gosub changeBeatNote beatTimer = beatTimer - 1 drawscreen goto startLoop changeMusicNote AUDF0 = musicData[musicPointer] if musicData[musicPointer] = $FF then AUDV0 = 0 else AUDV0 = 8 musicPointer = musicPointer + 1 musicTimer = musicData[musicPointer] musicPointer = musicPointer + 1 if musicPointer > 31 then musicPointer = 0 ;value is (number_of_notes * 2) - 1 return changeBeatNote AUDF1 = beatData[beatPointer] if beatData[beatPointer] = $FF then AUDV1 = 0 else AUDV1 = 8 beatPointer = beatPointer + 1 beatTimer = beatData[beatPointer] beatPointer = beatPointer + 1 if beatPointer > 23 then beatPointer = 0 ;value is (number_of_notes * 2) - 1 return data musicData 18,26,-1,10,18,20,-1,40,15,26,-1,10,15,20,-1,40 16,26,-1,10,16,20,-1,40,17,26,-1,10,17,20,-1,40 end data beatData 120,2,-1,22,40,2,-1,10,120,2,-1,22,120,2,-1,10,40,2,-1,4,120,2,-1,16 end