Do VERA support DPCM?

Chat about anything CX16 related that doesn't fit elsewhere
Post Reply
GTR3QQ
Posts: 146
Joined: Wed Apr 05, 2023 8:04 pm

Do VERA support DPCM?

Post by GTR3QQ »

I remember on the official wiki, only 8bit PCM was listed.
I kinda gotten worried that my 16ch. PSG + 8FM + 8BIT PCM wouldn't fly.
the zsm is about 170kbs.
So I included a special version where all precautions are gone.
And how much CPU would it cost to have all channels play at the same time.
DragWx
Posts: 342
Joined: Tue Mar 07, 2023 9:07 pm

Re: Do VERA support DPCM?

Post by DragWx »

The PCM channel on the VERA is just a buffer that you fill with the raw sample data you want it to output.

How you fill that buffer is completely up to you; so if you want to store your digital samples as DPCM (or ADPCM or any number of other compressed formats), it'll be up to your program to decode that compressed data into plain samples when it goes to fill the PCM buffer on the VERA, but you could do it.
GTR3QQ
Posts: 146
Joined: Wed Apr 05, 2023 8:04 pm

Re: Do VERA support DPCM?

Post by GTR3QQ »

DragWx wrote: Thu Apr 20, 2023 4:28 pm The PCM channel on the VERA is just a buffer that you fill with the raw sample data you want it to output.

How you fill that buffer is completely up to you; so if you want to store your digital samples as DPCM (or ADPCM or any number of other compressed formats), it'll be up to your program to decode that compressed data into plain samples when it goes to fill the PCM buffer on the VERA, but you could do it.
thanks.
I only programmed for it from higher levels as now.
All examples I can find are using 16bit or 8bit PCM.
So I got confused.
BruceRMcF
Posts: 224
Joined: Sat Jan 07, 2023 10:33 pm

Re: Do VERA support DPCM?

Post by BruceRMcF »

GTR3QQ wrote: Fri Apr 21, 2023 3:58 pm
DragWx wrote: Thu Apr 20, 2023 4:28 pm The PCM channel on the VERA is just a buffer that you fill with the raw sample data you want it to output.

How you fill that buffer is completely up to you; so if you want to store your digital samples as DPCM (or ADPCM or any number of other compressed formats), it'll be up to your program to decode that compressed data into plain samples when it goes to fill the PCM buffer on the VERA, but you could do it.
thanks.
I only programmed for it from higher levels as now.
All examples I can find are using 16bit or 8bit PCM.
So I got confused.
It's a buffer that feeds the PCM data at the specified rate. The data can be 8 bit or 16bit, and can be mono or stereo, but what you put into the Vera First-In, First-Out buffer is the raw data, so for a given rate, you have to feed it four times faster for 16bit stereo than for 8bit mono.

Extracting the raw data from any given compressed PCM file format is "left as an exercise for the reader", but the routines from open source tools are handy guidance for the required process.
GTR3QQ
Posts: 146
Joined: Wed Apr 05, 2023 8:04 pm

Re: Do VERA support DPCM?

Post by GTR3QQ »

BruceRMcF wrote: Fri Apr 21, 2023 5:00 pm
GTR3QQ wrote: Fri Apr 21, 2023 3:58 pm
DragWx wrote: Thu Apr 20, 2023 4:28 pm The PCM channel on the VERA is just a buffer that you fill with the raw sample data you want it to output.

How you fill that buffer is completely up to you; so if you want to store your digital samples as DPCM (or ADPCM or any number of other compressed formats), it'll be up to your program to decode that compressed data into plain samples when it goes to fill the PCM buffer on the VERA, but you could do it.
thanks.
I only programmed for it from higher levels as now.
All examples I can find are using 16bit or 8bit PCM.
So I got confused.
It's a buffer that feeds the PCM data at the specified rate. The data can be 8 bit or 16bit, and can be mono or stereo, but what you put into the Vera First-In, First-Out buffer is the raw data, so for a given rate, you have to feed it four times faster for 16bit stereo than for 8bit mono.

Extracting the raw data from any given compressed PCM file format is "left as an exercise for the reader", but the routines from open source tools are handy guidance for the required process.
Hey there!
I think I understand now the compress or not is a me problem.
Cool. I'll be using 8 bit PCM until I can't or looking for Famicom Flavor inside.
Ed Minchau
Posts: 503
Joined: Sat Jul 11, 2020 3:30 pm

Re: Do VERA support DPCM?

Post by Ed Minchau »

BruceRMcF wrote: Fri Apr 21, 2023 5:00 pm Extracting the raw data from any given compressed PCM file format is "left as an exercise for the reader", but the routines from open source tools are handy guidance for the required process.
To get my PCM audio, I used Audacity to record audio at a ridiculous bit rate, then used Audacity to resample at the desired frequency and to save as a RAW audio file (no header).
GTR3QQ
Posts: 146
Joined: Wed Apr 05, 2023 8:04 pm

Re: Do VERA support DPCM?

Post by GTR3QQ »

Ed Minchau wrote: Sat Apr 22, 2023 12:59 am
BruceRMcF wrote: Fri Apr 21, 2023 5:00 pm Extracting the raw data from any given compressed PCM file format is "left as an exercise for the reader", but the routines from open source tools are handy guidance for the required process.
To get my PCM audio, I used Audacity to record audio at a ridiculous bit rate, then used Audacity to resample at the desired frequency and to save as a RAW audio file (no header).
May I ask why?
To avoid aliasing? Some unknown voodoo magic?
Ed Minchau
Posts: 503
Joined: Sat Jul 11, 2020 3:30 pm

Re: Do VERA support DPCM?

Post by Ed Minchau »

GTR3QQ wrote: Sat Apr 22, 2023 6:31 pm
Ed Minchau wrote: Sat Apr 22, 2023 12:59 am
BruceRMcF wrote: Fri Apr 21, 2023 5:00 pm Extracting the raw data from any given compressed PCM file format is "left as an exercise for the reader", but the routines from open source tools are handy guidance for the required process.
To get my PCM audio, I used Audacity to record audio at a ridiculous bit rate, then used Audacity to resample at the desired frequency and to save as a RAW audio file (no header).
May I ask why?
To avoid aliasing? Some unknown voodoo magic?
Because it was easy. Audacity lets you sample audio an then resample at a different rate. You can get it to output 8 bit or 16 bit, stereo or mono, and at any rate you desire.
BruceRMcF
Posts: 224
Joined: Sat Jan 07, 2023 10:33 pm

Re: Do VERA support DPCM?

Post by BruceRMcF »

Ed Minchau wrote: Sat Apr 22, 2023 11:54 pm
GTR3QQ wrote: Sat Apr 22, 2023 6:31 pm ... May I ask why?
To avoid aliasing? Some unknown voodoo magic?
Because it was easy. Audacity lets you sample audio an then resample at a different rate. You can get it to output 8 bit or 16 bit, stereo or mono, and at any rate you desire.
Easy is good!

Also, sampling at a high rate does in fact help avoid aliasing if you try one rate and decide later to try a higher one for better sound or a lower one for smaller memory footprint and lower CPU burden.
Post Reply