Jump to content

Recommended Posts

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.

Link to comment
https://forums.atariage.com/topic/89580-question-for-batari/
Share on other sites

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.

Link to comment
https://forums.atariage.com/topic/89580-question-for-batari/#findComment-1088838
Share on other sites

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

Link to comment
https://forums.atariage.com/topic/89580-question-for-batari/#findComment-1088860
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...