PCMENC from MSX

Post Reply
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

PCMENC from MSX

Post by cborn »

Hello
I did not see any 'pcmenc' link here so maybe you like that player from https://www.msx.org/news/software/en/pcm-encoder
https://www.msx.org/downloads/related/s ... ncoder-001

i ported the vplayer to zx spectrum in asm http://cborn.nl/zxfiles/wav2ay/

I encountered some problems (newbie for ever?) and the result was that infact my files for ZX were to short.
a rewrite was proposed by a MSX member, I still have to make a proper install my self, but did not succeed a) being 'new'bie and 2) working on linux while this program is aimed for windows.
https://www.msx.org/forum/development/m ... psg?page=8

So i want to ask if people know this program and if people can help with making a proper working linux (debian) version.
Since pcm_encoder aims on retro computers and is MSX i thoughed this place to be a good one to ask about.

perhaps its even possible to introduce this routine to Z88dk but, well , sorry, i only know some Z80 and still learn my C.
I hope these programs are usefull anyway. timings on MSX are MUCH faster then on ZX since on MSX only a single 8bit OUT put is enough while ZX needs two different 16 bit adresses for the same result.

cheers
Chris
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: PCMENC from MSX

Post by stefano »

I'm looking for a 4bit wav encoder/converter able to pack 2 samples in a single byte.
How is pcmenc outputting the results?
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: PCMENC from MSX

Post by cborn »

Hi, it has several output forms and actualy you should be able to choose from 2x4 bit up to 2 samples in 12 bit

the readme files has a resonable explanation, but can be much larger afai am corcerned.
1) spending three PSG transitions per sample in input: this leads to the
best SNR (the lowest quantization noise) but limits the sampling
frequency to 11,025kHz. The unpacked encoding rate is 3x4=12bit per
sample.

2) spending two PSG transitions per input sample: you have average SNR
and you can rise the sampling frequency up to 22,050kHz. The unpacked
encoding rate is 3x4/2=6bit per sample.

3) one PSG transition per input sample: minimum quality in exchange of
maximum sampling frequency. Using the provided replayer you can reach
44100kHz. The unpacked encoding rate is 4bits per sample.
this is how i batch this windows prog:

Code: Select all

echo pcmenc uses 12 variables, we use 10 now
ECHO pcmenc.exe (-r -e ) -p 0 -cpuf 3546900 -dt1 97 -dt2 97 -dt3 175 -a 115 -rto %2 -c 2 -i 2  %1
pcmenc.exe -p 0 -cpuf 3546900 -dt1 97 -dt2 97 -dt3 175 -a 115 -rto %2 -c 2 -i 2  %1
-dt1 97 -dt2 97 -dt3 175
are the time measurement between the wave parts of A b and C channel.... not linear but clear

btw
wav2ay migth be the simple solution, but the timing for MSX is different.
i optimised the player for exact 317 tstate per sample output on ZX spectrum 128.

i (tried) to write a 2 samples in 1 byte packer for wav2ay
www.cborn.nl/zxfiles/wav2ay/r2ayR8_036.asm

actualy its over a year that i was busy with these routines so i have to check it out myself again.
Post Reply