+atari2600land Posted June 22, 2006 Share Posted June 22, 2006 Could you convert the code on www.alienbill.com/2600/basic/music to having line numbers? I tried and this is as far as I got: 10001 b=$FF 10002 c=0 10003 dim tempaudv=t 10005 AUDV0=0 10006 AUDC0=6 10009 if c=0 then goto 10012 10010 c=c-1 10011 goto 10009 10012 b=b+1 10013 AUDF0 = musicData[b] 10014 t=8 10015 if musicData[b] = $FF then t = 0 10016 AUDV0 = t 10017 b = b + 1 10018 c = musicData[c] 10019 if b > 31 then b = 16-1 10020 return 10025 data musicData 4,30,5,30,6,30.7,30,8,30,9,30,10,30,11,30 end And I got a whole bunch of error messages when I compiled it. I had to change the dim musicTimer, etc. to letters because I got even more error messages when I compiled it. All I want is 7 notes played in AUDC=6. I don't care which ones, I can change them later. Quote Link to comment https://forums.atariage.com/topic/89580-question-for-batari/ Share on other sites More sharing options...
+batari Posted June 23, 2006 Share Posted June 23, 2006 10025 data musicData 4,30,5,30,6,30.7,30,8,30,9,30,10,30,11,30 end [/code] The only error I see is in the above line, where there is a dot (30.7) when I think there should be a comma (30,7). Quote Link to comment https://forums.atariage.com/topic/89580-question-for-batari/#findComment-1088576 Share on other sites More sharing options...
MausBoy Posted June 23, 2006 Share Posted June 23, 2006 The b and c variables make no sense to me - b = 16 - 1 ? What's that supposed to do that b = 15 won't? I can't follow this code at all... Quote Link to comment https://forums.atariage.com/topic/89580-question-for-batari/#findComment-1088580 Share on other sites More sharing options...
+atari2600land Posted June 23, 2006 Author Share Posted June 23, 2006 10025 data musicData 4,30,5,30,6,30.7,30,8,30,9,30,10,30,11,30 end [/code] The only error I see is in the above line, where there is a dot (30.7) when I think there should be a comma (30,7). I changed it to a comma, and I got one repeating noise going da-da-da-da-da-da really fast. Quote Link to comment https://forums.atariage.com/topic/89580-question-for-batari/#findComment-1088838 Share on other sites More sharing options...
+Atarius Maximus Posted June 23, 2006 Share Posted June 23, 2006 The b and c variables make no sense to me - b = 16 - 1 ? What's that supposed to do that b = 15 won't? I can't follow this code at all... Although I don't understand what it does, the original code has a '#-1'. Comparing atari2600land's code to the original, it looks like that's the line that was changed. Original code from http://www.alienbill.com/2600/basic/music: dim musicPointer=a dim musicTimer=b dim tempaudv=t rem VOLUME DOWN AND SET CHANNELS AUDV0=0 AUDC0=DISTORTION rem INITIALIZE POINTERS AND TIMERS musicPointer=$FF musicTimer=0 startLoop rem TIME TO UPDATE NOTE? if musicTimer = 0 then gosub changeMusicNote musicTimer = musicTimer - 1 drawscreen goto startLoop changeMusicNote musicPointer = musicPointer + 1 AUDF0 = musicData[musicPointer] tempaudv = 8 if musicData[musicPointer] = $FF then tempaudv = 0 AUDV0 = tempaudv musicPointer = musicPointer + 1 musicTimer = musicData[musicPointer] rem value is (2 * #_OF_NOTES) - 1 if musicPointer > (2 * #_OF_NOTES) - 1 then musicPointer = #-1 return data musicData LIST OF FREQUENCY, LENGTH Quote Link to comment https://forums.atariage.com/topic/89580-question-for-batari/#findComment-1088860 Share on other sites More sharing options...
+atari2600land Posted June 23, 2006 Author Share Posted June 23, 2006 So do I put a # in the code, or does it represent a number? Quote Link to comment https://forums.atariage.com/topic/89580-question-for-batari/#findComment-1088920 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.