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: 1648
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: 1648
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: 1648
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: 677
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: 1078
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: 705
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: 705
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
Mike
Matt
Hypnosis/TSD
lotus_skylight
Guests online: 88
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 X-Mas Demo 2024  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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