Jump to content
IGNORED

RevEng's Sound Collection in bB


Karl G

Recommended Posts

In the 7800 Programming forum, @RevEng has a nice collection of TIA sound effects that anyone may use for their projects, wrapped-up with a nice 7800 player to try out those sounds. The data is easy enough to understand and extract from the code to use in 2600 projects, but I thought it might be nice to have a bB version of the sound player too. I automated the conversion of the data and the text with a Python script, and since the text minikernel only has 12 characters, some of the descriptions have been truncated. It should still give a good enough idea as to which is which, however.

 

Just for fun, I also added a visual representation of the sound as it is playing. The position of the vertical bar indicate the sound's pitch, and the color and brightness of the bar indicate the channel (voice) and the volume of the sound, respectively.

 

926708516_Screenshotfrom2023-03-0109-40-58.thumb.png.6ad45605861b2a24ddb7ddb32f219335.png

 

bbsoundtest-3.zip

 

  • Like 13
  • Thanks 2
Link to comment
Share on other sites

4 hours ago, Karl G said:

I automated the conversion of the data and the text with a Python script, and since the text minikernel only has 12 characters, some of the descriptions have been truncated. It should still give a good enough idea as to which is which, however.

I think some of the labels or sounds are getting shifted. For example, 033 is labeled "WOLFWHISTLE" but the wolf whistle sound is played on sound 34. I noticed if I start from 001 and go backward, the sound and label are aligned until 102 or 103. The WILHELM scream label is numbered 102, but plays on 101.

Edited by 8bitPoet
  • Thanks 1
Link to comment
Share on other sites

32 minutes ago, 8bitPoet said:

I think some of the labels or sounds are getting shifted. For example, 033 is labeled "WOLFWHISTLE" but the wolf whistle sound is played on sound 34. I noticed if I start from 001 and go backward, the sound and label are aligned until 102 or 103. The WILHELM scream label is numbered 102, but plays on 101.

Thank you, and good catch! I've uploaded a corrected vwersion.

  • Like 3
Link to comment
Share on other sites

On 3/2/2023 at 4:18 AM, Random Terrain said:

Sound 61 "whoa" and sound 63 "yahoo" reminds me of this:

 

 

That's not really coincidental, since from what I understand he produced most or all of these with his soundtotia utility, converting WAV files to Atari sound data.

  • Like 1
Link to comment
Share on other sites

Glancing over the code, it looks like you are saving room by using nybbles. I stopped using nybbles because it became too confusing for me (I stopped programming for a fairly long while because of it). If someone takes over bB in the future and adds automatic nybble variables so they act like small easy-to-use variables, I'll go back to them. Until then, how do I convert the data to fit this pattern:

 

V,C,F

D

 

V - Volume (0 to 15)

C - Control [a.k.a. tone, voice, and distortion] (0 to 15)

F - Frequency (0 to 31)

D - Duration

 

Here is an example of how the data looks:

 

   15,8,2
   1
   8,8,2
   1
   4,8,2
   1
   0,8,2
   4

   15,8,2
   1
   8,8,2
   1
   4,8,2
   1
   0,8,2
   4

   15,8,2
   1
   8,8,2
   1
   4,8,2
   1
   0,8,2
   11

   15,8,2
   1
   8,8,2
   1
   4,8,2
   1
   0,8,2
   4
   0,0,0
   8
   255

 

 

Thanks.

Link to comment
Share on other sites

18 hours ago, Random Terrain said:

Glancing over the code, it looks like you are saving room by using nybbles. I stopped using nybbles because it became too confusing for me (I stopped programming for a fairly long while because of it). If someone takes over bB in the future and adds automatic nybble variables so they act like small easy-to-use variables, I'll go back to them. Until then, how do I convert the data to fit this pattern:

 

V,C,F

D

 

V - Volume (0 to 15)

C - Control [a.k.a. tone, voice, and distortion] (0 to 15)

F - Frequency (0 to 31)

D - Duration

 

Here is an example of how the data looks:

 

   15,8,2
   1
   8,8,2
   1
   4,8,2
   1
   0,8,2
   4

   15,8,2
   1
   8,8,2
   1
   4,8,2
   1
   0,8,2
   4

   15,8,2
   1
   8,8,2
   1
   4,8,2
   1
   0,8,2
   11

   15,8,2
   1
   8,8,2
   1
   4,8,2
   1
   0,8,2
   4
   0,0,0
   8
   255

 

 

Thanks.

Yes, that is correct. I combine the channel and volume into a single byte, and the other byte is for frequency (too big for a nybble). I don't have a duration, but instead repeat the line of data for the duration needed.

 

So, here ls one of the sounds for an example:

Init_chirp
    sdata sfx_chirp = SoundDataLoc
    $4e, $07
    $4e, $0a
    $4e, $0c
    $4f, $09
    $4e, $0a
    $41, $07
    $40, $09
    $FF, $FF
end
    return
; End Init_chirp

The first byte of each data line is channel and volume combined. Breaking that up into two bytes in data is dead simple - just put a comma, space and "$" after the first digit to make it into two numbers. So, after doing that, it would be:

Init_chirp
    sdata sfx_chirp = SoundDataLoc
    $4, $e, $07
    $4, $e, $0a
    $4, $e, $0c
    $4, $f, $09
    $4, $e, $0a
    $4, $1, $07
    $4, $0, $09
    $FF, $FF
end
    return
; End Init_chirp

That is now 3 bytes for the channel, then volume, and then frequency. There is no duration since each line is only 1 frame.

 

I can also easily enough have my script write out my data in the format you asked for. Is it considered somewhat "standard" format for bB projects since that was what the VbB tool would produce?

  • Like 1
Link to comment
Share on other sites

2 hours ago, Karl G said:

I can also easily enough have my script write out my data in the format you asked for. Is it considered somewhat "standard" format for bB projects since that was what the VbB tool would produce?

 

Some people came up with it in the forums somewhere and I guess we just stuck with it until something better came along. It's kind of been "standard" since around 2008.

 

After creating a sound effect using the Music and Sound Editor, it's fairly easy to edit the data after it is in the game code without putting it back through the editor. I've tweaked sound effects countless times after it was added to the code of a game. I've changed things like volume, duration, and so on right there in the game code until I got a sound just right.

 

Here are some example programs that use that kind of data:

 

https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#sound_example_no_bank

 

Sound effect data for Seaweed Assault can be seen here:

 

https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_seaweed_assault

 

 

If you can write a script that will spit out that kind of data, that would be helpful for those of us who use that style in our programs.

 

 

Thanks.

Link to comment
Share on other sites

  • 1 month later...
On 5/3/2023 at 10:46 AM, Random Terrain said:

 

Did you get a chance to do that yet?

 

 

Thanks.

It had slipped my mind for a bit. I also noticed that I wasn't using the latest version of the collection, so many sounds are missing from this version. I'll get to putting out an updated one soonish, I think.

  • Like 1
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...