Posted: Wed Jan 24, 2007 7:37 am
Z80 is there for SMS compatibility thats why YM2612 int is not connected.
Sega Megadrive/Genesis development
http://gendev.spritesmind.net/forum/
I've exactly the same problem with 4 bits sample. I did my own converter and tried several method but i can't get a decent sound. It's heavily distorted compared to the original 8 bits sample. 4 bits is anyway very bad quality but i guess that a simple "remove 4 lower bits" isn't enough to convert correctly a 8 bits to a 4 bits sample. Some sort of noise filter and roundind process should be used. I searched for a 8 bits to 4 bits audio converter but i can't find something which give acceptable result :-/Fonzie wrote:I have another question
I tried to make a DAC player that use 4bit samples. So i took a 8bit .wav sample and removed the lower 4bits (set to 0) and i get... a background "CHHHHHH" over my sample. I don't think it is normal, or i misunderstood something about 4bit samples?
I also played with downsampling 8bit samples... to 16 11 8 4 2 1khz... And i noticed that, on my computer sound cart, the samples don't get grainy at all... It just get woofed (loosing details)... On megadrive, a 1khz sample would sound horrible, what does my soundcart do to avoid that?
Code: Select all
open "wavfile.wav" for binary as #1 'open source file
open "convert.4bt" for binary as #2 'destination file
Lenght&=(lof(1)-58)\2 'get the lenght - header
seek #1, 58 'skip header
for i& = 0 to Lenght& 'loop until all data processed
n1%=((asc(input$(#1,1)) and &Hf0) \ 16 'get a nibble
n2%=((asc(input$(#1,1)) and &Hf0) 'and another
b$=chr$(n1% or n2%) 'make them one byte
put #2,,b$ 'write it
next i& 'and start all over again
close 'close open files
Delta 4 bits is exactly the ADPCM 4 bits stuff. As far i can understand it, instead of coding the height of the sample, we code the delta. But the final output must be done in a 8 bits DACFonzie wrote:I see... Maybe it was 4bit adpcm... I cannot check since it was rented game...
If i remember correctly, the 32x documentation mentions that GEMS3.0 supports "Delta 4bit" DAC... I suspect it is a sort of adpcm-looking format specialy designed for the z80.
I done almost the same stuff, but in DelphiTmEE co.(TM) wrote:Audio converter in QB, converts ordinary 8-bit PCM wav to 4-bit PCM:it is slow but makes the converison (well, not to wav)Code: Select all
open "wavfile.wav" for binary as #1 'open source file open "convert.4bt" for binary as #2 'destination file Lenght&=lof(1)-58 'get the lenght - header seek #1, 58 'skip header for i& = 0 to Lenght& 'loop until all data processed n1%=((asc(input$(#1,1)) and &Hf0) \ 16 'get a nibble n2%=(asc(input$(#1,1)) and &Hf0 'and another b$=chr$(n1% or n2%) 'make them one byte put #1,,b$ 'write it next i& 'and start all over again close 'close open files
Technically basic 4-bit delta PCM is just DPCM, ADPCM is slightly more sophisticated in that the compressor and decompressor try to predict the next value and a small delta value is provided to correct the error in the prediction. I suppose you could say that DPCM is an ADPCM variant where the next value is predicted to be the same as the current value.Stef wrote:Delta 4 bits is exactly the ADPCM 4 bits stuff. As far i can understand it, instead of coding the height of the sample, we code the delta. But the final output must be done in a 8 bits DACFonzie wrote:I see... Maybe it was 4bit adpcm... I cannot check since it was rented game...
If i remember correctly, the 32x documentation mentions that GEMS3.0 supports "Delta 4bit" DAC... I suspect it is a sort of adpcm-looking format specialy designed for the z80.
I don't know if you have tested Duke3D on the real thing, but I can say, that it looks and sounds awful on emulators, sound is bad especially on Gens, because its DAC is not very good. On the real thing, its a different story (mostly).Stef wrote:5 Khz is not something which can called "pretty good", but i've to admit that sound not that bad at least