Custom sounds?

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Custom sounds?

Post by Gambit37 »

Has anyone yet cracked how to replace the sounds in graphics.dat?

Between them, Rain, Charlatan and Christophe seem to know the structure of this file. Rain's DMextract program extracts all the data files and there are a bunch of .dats that are clearly the sound data. The tool can recompile a graphics.dat to use new graphics, so...

How difficult is it to take it to the next step and add similar customisation of sounds?
User avatar
ChristopheF
Encyclopedist
Posts: 1544
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Post by ChristopheF »

Changing sounds for the PC or Amiga versions would be very easy. The format is documented on my site. This is basically raw uncompressed digital sound data that you can open in sound editing programs like goldwave.

For the Atari ST version, though, this is more difficult. The sounds are compressed using something like ADPCM encoding I think, but I have never investigated enough in understanding the details (thus no documentation for ST sounds). Maybe Paul knows how the sounds are decoded in CSBwin.
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Paul? Can you offer any insight into this -- I'd really like to have some custom sounds in my new dungeon....
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

replacing snd1

Post by kentaro-k.21 »

hi.

i have just stealthily uploaded the tool at dmweb Encyclopaedia forum:
http://dmweb.free.fr/Forum/read.php?f=8&i=122&t=122

EDIT: next interpretation is brought from reverse engineering of CSBwin source code. thus, actual format may be different from original format representation.
snd1 is just 4-bit 6000Hz pcm wave form format, and accepts easy RLE compression. (all thanks for CSBwin source!)
Last edited by kentaro-k.21 on Fri May 14, 2004 9:12 pm, edited 1 time in total.
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Woo Hoo -- thanks you very much! Am trying it at the moment...

I have a small problem -- when I import new sounds, they have a lot of noise on them. I am using Sound Forge to convert to 6,000Hz at 8-bit (I can't go down to 4-bit).

Is this the problem?

When I export a SND1 to a WAV, it creates a 6000Hz 8bit WAV. If I re-import that immediately, it sounds perfect.

What is the difference between my WAVs and the ones created by your tool??
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

I've done some investigating into this. I used StripWav to clean up my WAV headers in case they were wrong, and it made no difference. I also tried copying the headers from your WAVs into mine, and that made no difference either.

I don't understand this. Your tool imports it's own generated WAVs perfectly, but if they are changed in any way, or replaced with something different, then the new SND1 files are full of noise...
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Here's a visual comparison.

The top file is my original sound file, resampled to 6000Hz / 8bit.

The bottom file is after i converted it to SND1 using your tool, then converted it back to WAV using the same tool.

Image

You can clearly see that your tool has simplified the wave form and added a lot of noise. But it doesn't do this if you extract a SND1 file, convert it to WAV then convert it back again! The file is identical in every way. Very strange!
Last edited by Gambit37 on Fri May 14, 2004 4:43 pm, edited 1 time in total.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

For what it is worth........I believe that if you look at
the CSBwin closely you will see that the 4-bit sound is
not exactly PCM in the same way that a .wav file is PCM.
The Atari sound system had an exponential response and
CSBwin attempts to reproduce this behaviour when it
converts the 4-bit samples to an in-memory wave file.

Whether I got it right is an open question.
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

hi.

---
i assumed the SND1 format is 4 bits PCM sound, and i coded the tool to exchange the data in that format. merely my guess.

Paul pointed that next description is not actual even if sound decoder exists in CSBwin, because it seems to be only quasi decoder.

> snd1 is just 4-bit 6000Hz pcm wave form format, and accepts easy RLE compression. (all thanks for CSBwin source!)

thus, this is my lying. i apologize for carelessness information supply.

---
> You can clearly see that your tool has simplified the wave form and added a lot of noise.

your point (about noise) is right (if there is implicit sympathy, that snd1 is just 4 bits PCM sound, between i and you).
because my tool just carries out thoughtless linear range conversion between 4 bits and 8 bits, as you point, converted dat file (quasi snd1) will contain noises.
about 'thoughtless linear range conversion', please look at the modified figure: http://homepage3.nifty.com/kkdf/0515_001.gif
if you hope, i will improve this behavior.

---
> For what it is worth

i guess it is worth that anyone can have their own sound on "CSBwin", even if CSBwin uses quasi sound decoder.
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

A way round this would be to create a proper 4-bit WAV file -- but I can't seem to find a tool that will do this. Everything I've tried only allows 8 or 16 bit sounds.

Does anyone know of a good tool that can save uncompressed 4-bit WAV files?
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

hi.
in Aug 2004, i had improved the encoder code a liitle bit, and new code was integrated into DM1GDED.
DM1GDED is still unpublished. development memo is available at my site: http://members.at.infoseek.co.jp/danmas ... M1GDED.htm
if anyone wanna try DM1GDED, i'll publish current development version. at least, it may help you to edit SND data easily.

DM1GDED has capable to edit some IMG/SND data in graphics.dat. it won't equip useful editor features found on ADGE (such as meaningful editor for 0558 raw data).

DM1GDED won't care for 0558 raw data, so your trial to change image size with DM1GDED causes messed up display in the game play. because ADGE has good features/UI to edit 0558 raw data effectively, DM1GDED won't support it for good.

if i continue to develop DM1GDED, i will improve so that it can cover weakness of ADGE.
User avatar
ChristopheF
Encyclopedist
Posts: 1544
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Post by ChristopheF »

I'd be glad to see the current dev version of DM1GDED if you post it somewhere.

What features will it include that are not in ADGE ?
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

hi, Christophe.

i'll publish soon, and i just a qeustion for you.

DM1GDED always depends on map files in your file decoder package to edit any img/snd/text data.
would you mind if i attach the map files to published rar archive?

about features, please don't hold your breath, there won't be fresh features in DM1GDED.
the purpose of DM1GDED was to replace your hard working (extract files, editing images/sounds and rebuild graphics.dat) can be done by DMExtract with easy way... very straight motive. i had another purpose to write DM1GDED last summer, but i cannot remember it now.
User avatar
ChristopheF
Encyclopedist
Posts: 1544
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Post by ChristopheF »

You can publish the .map files with your program if you want, no problem on my side.
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

thanks, i uploaded current dev ver on my file site, it is a little bit large (213k).
http://homepage3.nifty.com/kkdf/DM1GDED.Rev.0.rar
User avatar
ChristopheF
Encyclopedist
Posts: 1544
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Post by ChristopheF »

Thanks for this tool. It make it easy to browse a graphics file.

In fact it is now possible to upload files up to 2 MB in size in the forums. Soon I will make available a new system for uploading files and sharing things on my web site.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

dianneandpaul.net/CSBwin

CSBuild1.75
FeedingFilter.rar (CSBwin 9.8v34)
CSBgraphics.exe version 3.0

Notice anything new?
User avatar
rain`
Artisan
Posts: 164
Joined: Sat Feb 19, 2005 11:44 pm

Post by rain` »

Paul Stevens wrote:dianneandpaul.net/CSBwin

CSBuild1.75
FeedingFilter.rar (CSBwin 9.8v34)
CSBgraphics.exe version 3.0

Notice anything new?
I haven't looked yet but I'm gonna take a guess...

More lack of backwards compatability? ^^

Good work =]
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Noticed. You did it!
I cannot export from CSBgraphics.dat, it only allows bmp.
Also, which formats are supported for the import?
EDIT: found it, it's PCM 11,025 kHz; 8 bits; Mono
Playing a sound this way doesn't respect the general volume settings from the menu.

In CSBgraphics.exe, when importing, giving a name of more than 16 characters crashes the application.
Putting a space in the name gives an error with an unclear message.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Ain't it nice that I left all this room for improvement?
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Nice indeed. And you also left some mysteries. Tonight I'll dream about the possible uses of the third parameter of &SOUND.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

The third parameter is there just in case we need it.

Two possibilities I mentioned before. Stopping any current sound
and discarding any subsequent sounds during the custom sound.
Perhaps a repeat count (although I don't know how to implement
it).
kentaro-k.21
Artisan
Posts: 178
Joined: Wed Dec 17, 2003 1:39 am
Location: Osaka, Japan
Contact:

Post by kentaro-k.21 »

Paul, it is the best approach to have custom sounds in CSBwin!

currently i don't understand the detail implement. so i'll check it, and i'll write a review (tutorial) about connection between CSBwin and CSBgraphics in the future.
User avatar
PaulH
Ghastly gastropod
Posts: 3763
Joined: Wed Aug 07, 2002 10:27 pm
Location: Level 6

Post by PaulH »

Very nice. Very, very nice. Will have to learn these DSA thingies.
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Does this support for custom sounds extend to all the existing sounds? Can we replace attack sounds, spell sounds, etc. in this way?
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Right now:
party attack sounds: no
monster attack sounds: yes
sound when casting: yes
explosions: no
moving sounds: no
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

It seems that the volume parameter has no effect at all: I tried from 1 to 100 and noticed no change.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4319
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Volume will work next time I post an executable. The volume parameter is
a divisor of the PCM samples. The menu volume divides by 2, 4, 8 in addition (no
pun intended).

We should implement a sound filter so any sound can be modified. Should be easy.

Edit: Maybe we can provide monster movement sounds.
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

Could you add a command parameter or a command line in the config.txt to set the "Attempt using DirectX" option by default? (even if it crashes the game when quiting, with long sounds it becomes almost obligatory to use a multichannel solution )

monster movement sounds: maybe a monster movement filter?

Does anyone have ripped the big steping sound from pc dm or amiga dm?
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

I've got all the sounds in good quality with added echo -- I'll mail you a zip.
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”