Jump to content
IGNORED

music problem


rpgfaker

Recommended Posts

I was playing around with the Music Starter code and this music crashes but I really don't understand what happened

 rem batari Basic Program
rem created 5/10/2010 7:11:25 AM by Visual bB Version 1.0.0.544
  rem  *****************************************************
  rem  *
  rem  *  Music Starter using data
  rem  *
  rem  *  Based on code posted in the Ballblazer thread at AtariAge:
  rem  *  http://www.atariage.com/forums/index.php?s=&showtopic=130990&view=findpost&p=1615280
  rem  *
  rem  *  Code adapted by Duane Alan Hahn (Random Terrain)
  rem  *
  rem  *  Explanation:
  rem  *  This has a 256-byte limitation.
  rem  *
  rem  *****************************************************


  set smartbranching on


  rem  *****************************************************
  rem  *  Create aliases for variables
  rem  *****************************************************
  dim duration=a
  dim rand16=z


  rem  *****************************************************
  rem  *  Variable descriptions
  rem  *****************************************************
  rem  *  duration - how long each note plays
  rem  *  x - data counter
  rem  *  rand16 - makes better random numbers


  rem  *  Volume off
  AUDV0=0
  AUDV1=0


  rem  *  Initialize duration and data counter
  duration = 1 : x = 0




  rem  *****************************************************
  rem  *
  rem  *  Main game loop starts here.
  rem  *
  rem  *****************************************************
MainLoop

  goto GetMusic
GotMusic

  drawscreen

  goto MainLoop




  rem  *****************************************************
  rem  *  Music
  rem  *****************************************************
GetMusic

  rem  *  Check for end of current note
  duration = duration - 1
  if duration>0 then GotMusic


  rem  *  Retrieve channel 0 data
  temp4 = musicData[x] : x = x + 1
  temp5 = musicData[x] : x = x + 1
  temp6 = musicData[x] : x = x + 1


  rem  *  Check for end of data
  if temp4=255 then duration = 1 : x = 0 : goto GotMusic


  rem  *  Play channel 0
  AUDV0 = temp4
  AUDC0 = temp5
  AUDF0 = temp6


  rem  *  Retrieve channel 1 data
  temp4 = musicData[x] : x = x + 1
  temp5 = musicData[x] : x = x + 1
  temp6 = musicData[x] : x = x + 1


  rem  *  Play channel 1
  AUDV1 = temp4
  AUDC1 = temp5
  AUDF1 = temp6


  rem  *  Set duration
  duration = musicData[x] : x = x + 1
  goto GotMusic




  rem  *****************************************************
  rem  *  Music Data Block
  rem  *****************************************************
  rem  *  Format:
  rem  *  v,c,f (channel 0)
  rem  *  v,c,f (channel 1) 
  rem  *  d
  rem  *
  rem  *  Explanation:
  rem  *  v - volume (0 to 15)
  rem  *  c - control [a.k.a. tone, voice, and distortion] (0 to 15)
  rem  *  f - frequency (0 to 31)
  rem  *  d - duration


  data musicData
  8,1,24
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,15
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,12
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,15
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,24
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,15
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,12
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,15
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,27
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,12
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,27
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,12
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,23
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,9
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,23
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,9
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,16
  0,0,0
  20


  255
end
  goto GotMusic

 

It seems to explode 4 notes from the end

Link to comment
Share on other sites

I think this sounds better without the diminished chords at the end and it's just short enough to fit without sdata

  data musicData
  8,1,24
  8,1,16
  20
  8,1,16
  0,0,0
  20
  8,1,15
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,12
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,15
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,24
  8,1,16
  20
  8,1,16
  0,0,0
  20
  8,1,15
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,12
  0,0,0
  20
  8,1,16
  0,0,0
  20
  8,1,15
  0,0,0
  20
  8,1,16
  0,0,0
  20

  8,1,27
  8,1,18
  20
  8,1,18
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,12
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,27
  8,1,18
  20
  8,1,18
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,12
  0,0,0
  20
  8,1,18
  0,0,0
  20
  8,1,13
  0,0,0
  20
  8,1,18
  0,0,0
  20

  255
end
  

 

music 2.bas.bin

Edited by rpgfaker
Link to comment
Share on other sites

Are you doing this by hand? Would be easier to use the latest vbb build. By pressing on the keys you can just create the music and it will tell you how many bytes of data it will occupy.

 

-Jeff

 

Wow thanks Jeff I didn't know there was a new version of VbB, I was using build 544. Too bad the music editor don't have a guitar fretboard instead of the keyboard I think musically faster on guitar.

 

** Is new version of VbB still compatable with codewiz?

Edited by rpgfaker
Link to comment
Share on other sites

Wow thanks Jeff I didn't know there was a new version of VbB, I was using build 544. Too bad the music editor don't have a guitar fretboard instead of the keyboard I think musically faster on guitar.

 

** Is new version of VbB still compatable with codewiz?

Should be. Let me know if you encounter an error.

 

-Jeff

Link to comment
Share on other sites

Yeah I tested it and it worked fine, btw the Music and Sound editor is missing under the 4(PURE) channel 21 which is a pure F tone.

Not according to this:

 

http://www.randomterrain.com/atari-2600-memories-batari-basic-music-sound.html#distortion4

 

Is that info wrong?

Link to comment
Share on other sites

Yeah I tested it and it worked fine, btw the Music and Sound editor is missing under the 4(PURE) channel 21 which is a pure F tone.

Not according to this:

 

http://www.randomterrain.com/atari-2600-memories-batari-basic-music-sound.html#distortion4

 

Is that info wrong?

 

Yeah I tested all those values thru my Boss Br-900's tuner frequency 21 (not channel my bad) of channel 4 is a true F value. A correct F minor triad can be produced in channel 4 as the series 21(F),18(G#),14©

 

But let me double check the value through my tuner

 

** it is about 5+ over but close enough to call F for music sake it should be available as a F+ :D

 

oh and here's another music track (my first with the new interface :thumbsup: )

music 3.bas.bin

Edited by rpgfaker
Link to comment
Share on other sites

If you find any more errors, please let me know. I just compared 21 to a music keyboard and it sounds close enough to me. I tested a certain number of notes myself, but mostly went by the chart.

 

 

Thanks.

Edited by Random Terrain
Link to comment
Share on other sites

If you find any more errors, please let me know. I just compared 21 to a music keyboard and it sounds close enough to me. I tested a certain number of notes myself, but mostly went by the chart.

 

 

Thanks.

 

Actually I didn't realize the music editor has an expert mode with all the notes :dunce: , so this all works out fine. The tones on channel 12 reminds me of a old gameboy rpg :lol:

Link to comment
Share on other sites

Actually I didn't realize the music editor has an expert mode with all the notes :dunce: , so this all works out fine. The tones on channel 12 reminds me of a old gameboy rpg :lol:

Although we have the Expert Mode, we still want the keyboards to have every acceptable note. If the keyboards are missing any perfectly good notes, they should be added.

 

Speaking of the editor, have you seen this yet:

 

http://www.randomterrain.com/atari-2600-memories-batari-basic-vbb.html#music_and_sound_editor

 

It's a work in progress.

Link to comment
Share on other sites

Actually I didn't realize the music editor has an expert mode with all the notes :dunce: , so this all works out fine. The tones on channel 12 reminds me of a old gameboy rpg :lol:

Although we have the Expert Mode, we still want the keyboards to have every acceptable note. If the keyboards are missing any perfectly good notes, they should be added.

 

Speaking of the editor, have you seen this yet:

 

http://www.randomterrain.com/atari-2600-memories-batari-basic-vbb.html#music_and_sound_editor

 

It's a work in progress.

 

That cleared some things up, I was wondering how the dual voice worked. After playing around some this morning I think the music editor needs a auto silence\pause\break to break notes, a key to make a:

0,0,0

0,0,0

4

would be really helpful. Here's a couple more songs, I figured out a sort of drum snare to simulate drums using channel 8 tone 5 on the last one

music 4.bas.bin this reminded me of gameboy rpg music

music 5.bas.bin fast arpeggios

music 6.bas.bin quirky drum thing

Link to comment
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...