Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Composing > Digitizing Sound Effects
2010-12-29 22:00
The Shadow

Registered: Oct 2007
Posts: 304
Digitizing Sound Effects

For the purposes of digitizing voices and other sounds for game sound effects, all suggestions are welcome. The ideal parameters are for a good program that can convert sound samples into a C=64 format. An ideal program is one that can have the sound effects take as little memory as possible and reasonably light on rastertime, without compromising sound quality. Ideas?
2010-12-29 22:07
Frantic

Registered: Mar 2003
Posts: 1627
Can't really give any theoretical/mathematical arguments to support this but:

My impression is that higher sample rate (such as 7200hz versus 3600hz) is more important to the perceived quality of the sample than higher bit depth (8bit versus 4bit). Hence, I would rather go for 4bit and 7200 hz than 8bit and 3600hz. That depends on the sound itself though. The quality difference will be most clearly audible for sounds that contain a bigger load of higher frequencies.

A common way to store 4bit sample data on the c64 is to have two 4bit sample values stored in the same byte as hi nibble and lo nibble respectively (or vice versa), to save some memory (compared to wasting four bits in each byte, as one would do when storing only one 4bit value in each byte in RAM).

Perhaps this helps somewhat?
2010-12-29 22:10
The Shadow

Registered: Oct 2007
Posts: 304
Yes Frantic that helps alot. The general aim is to have something compact enough to fit in a game. Would 4bit and 7200 hz be much smaller in space?
2010-12-29 22:14
Frantic

Registered: Mar 2003
Posts: 1627
4bit/7200hz (A) is equal in space to 8bit/3600hz (B), since (A) takes half the amount of RAM for each sample compared to (B), but on the other hand (A) uses twice as many samples each "time unit" than (B), so it evens out.

By the way.. I use a command line utility called "SOX" which is available for many different platforms to do conversion to C64-ish sample rates. Perhaps you can use that too? In addition, you will need some script or something that stuffs two 4bit values into one byte (in case you use 4bit samples).

Anyway.. As I said.. What sample rate that will be acceptable is a highly subjective judgement, and it also depends on the actual frequency contents of the actual sound that you are trying to play. Hence you should do some tweaking to find a sample rate that gives you a reasonable result. Perhaps you want that oldschool touch to the sound? In that case 4bit sound may be even "better" than 8bit sound, if you see what I mean..
2010-12-29 22:19
The Shadow

Registered: Oct 2007
Posts: 304
Very cool. Any good programs for this purpose are needed.
2010-12-29 22:23
Frantic

Registered: Mar 2003
Posts: 1627
By the way, I realized that I wrote the wrong sample rates... I was thinking of 7800hz versus 3900hz rather than 7200hz versus 3600hz.

...and even more exactly 7820hz versus 3910hz; at least on a PAL system with 312 raster lines and a clock frequency of 50.125hz.

7820hz is every second raster line on a PAL system, and 3910hz is every fourth raster line. Anyway.. You seem to be on NTSC, so the exact rates you would be using would be slightly different in any case.
2010-12-29 23:25
enthusi

Registered: May 2004
Posts: 675
Hi, in
Heartlight 64 Preview I used the original sample-WAVs from the PC game. Sampled down to 4bit 8Khz with a few lines of C code.
4 bit give you the big advantage of high/low-nibble data.
Also you can easyly use different sample-rates for different fx which is partially integrated in the preview above. Surely not all kinds of sounds require 8 khz. Also at 8 khz you dont have THAT much CPU time left. In Heartlight the NMI sample player is active permanently and merely feed with data when an fx is triggered. Don't judge the sample quality of HL64 - final optimization not done yet...
2010-12-30 10:18
MagerValp

Registered: Dec 2001
Posts: 1055
If you have a few CPU cycles to spare, I'd suggest using delta compression (as invented by Robin Harbron) for the samples:
  bit  d418
  0    no change
  10   -1
  11   +1
at ~8 kHz it's nearly lossless, uses about 1.5 bits per sample instead of 4, and is simple to unpack.
2010-12-31 01:45
algorithm

Registered: May 2002
Posts: 702
Alternatively 1 bit dynamic delta modulation can be used. eg per specific amount of chunk values (256 samples) the encoder can determine an optimum step size then encode the value with an unset bit as minus the step value and set bit as plus the step value.
The encoder can work with several future samples to generate least error.

Two bit delta modulation gives the possibility of two step values.

Even less processor intensive decoding would be via the Vector Quantisation route, but the encoder would be complex in comparison (this can be combined ofcourse with the dynamic deltamodulation :-))
2011-01-03 19:34
The Shadow

Registered: Oct 2007
Posts: 304
Alternately, is there a possible way to blend music and sound effects together such as music playing with sound effects interrupting the music seamlessly?
2011-01-03 19:45
algorithm

Registered: May 2002
Posts: 702
You can use the 8 bit audio method but the non-cycle important method would use 2 sid channels (one seeking to the desired level) while the other one is set etc which will only give you one sid channel for music.

Alternatively the standard 4 bit method via $d418 (but on new sid this may be problematic (although may be be solved by using a null channel to boost the digi)

Another method would be to synthesize the sound effect using sid waveforms (but this would not really be that useful with a single channel)
 
... 3 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
sln.pixelrat
iAN CooG/HVSC
Apollyon/ALD
Jetboy/Elysium
Andy/AEG
apprentix
CA$H/TRiAD
Alakran_64
Acidchild/Padua
Knut Clausen/SHAPE/F..
Martin Piper
Guests online: 151
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Webmasters
1 Slaygon  (9.7)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.044 sec.