CPCWiki forum

General Category => Programming => Topic started by: zhulien on 14:15, 22 May 23

Title: Best Quality Samples possible from CPC
Post by: zhulien on 14:15, 22 May 23
I saw this awesome C64 demo on youtube that plays music at 48Khz on an unmodified C64 with extra RAM.

https://www.youtube.com/watch?v=Q2Me-tpEI6w

Reading the description here on how it works:

http://brokenbytes.blogspot.com/2018/03/a-48khz-digital-music-player-for.html

I was wondering, we have compiled sprites on CPC and we have faster bank switching - if a sample was a compiled sample across the entire 64kb of banked RAM doing 64k bank switches (C0, C2, CA, ...) what awesomeness can be pumped out of AY on an unmodified CPC with extra RAM?

Must a CPC use triangles simulated with 3 channels to get a good sample quality?
Title: Re: Best Quality Samples possible from CPC
Post by: zhulien on 14:17, 22 May 23
btw, I can't imagine loading a 16mb sample on C64 from 95 floppy discs over a period of 3 days to play it... (3 days is my guess)
Title: Re: Best Quality Samples possible from CPC
Post by: roudoudou on 15:22, 22 May 23
it's possible on ZX spectrum or with a Play2CPC/PlayCity to have a very good quality but not on a CPC stock because of the amount of time required to select another register and setting it

anyway, back in days, we had some good samples in Morteville Manor :P
Title: Re: Best Quality Samples possible from CPC
Post by: Prodatron on 16:10, 22 May 23
The CPC can play 62,5kHz Samples on the internal PSG, if you use "compiled" samples.
This requires 10 bytes per sample:

        LD  A,n    ;2
        OUT  (C),A  ;4      #f4xx,sample
        EXX        ;1
        OUT  (C),E  ;4      #f6xx,#80
        OUT  (C),D  ;4      #f6xx,#00
        EXX        ;1  -> 16 nops, 10bytes

If you have 1 MB the duration of the sample will be 1,67 seconds :laugh: :laugh:

The CPC can play 55,5kHz Samples on the internal PSG, if you use "normal" sample data and unroll the code a lot:

        LD  A,(HL) ;2
        INC HL      ;2
        OUT  (C),A  ;4      #f4xx,sample
        EXX        ;1
        OUT  (C),E  ;4      #f6xx,#80
        OUT  (C),D  ;4      #f6xx,#00
        EXX        ;1  -> 18 nops

If you have 1 MB the duration of the sample will be nearly 19 seconds.
So with the full 4MB you can play for about 75 seconds.


*EDIT* There is a sample player for the MSX, which combines all 3 PSG channels for producing 8bit like sample output. On the CPC this would be too slow (and sounds strange if you don't mix the channels to a mono signal, like on the MSX), if you don't use something like the PlayCity (what Roudoudou said). So these maximum values are only possible with a mono 4bit PSG channel (and without compression like in this C64 project of course).
Title: Re: Best Quality Samples possible from CPC
Post by: roudoudou on 16:18, 22 May 23
the high-quality methods on ZX is based on very fast update of the 3 voices (and a mono speaker output), not the overall replay freq
Title: Re: Best Quality Samples possible from CPC
Post by: zhulien on 18:09, 22 May 23
Are there any sample players for playcity currently?
Title: Re: Best Quality Samples possible from CPC
Post by: lmimmfn on 00:27, 23 May 23
Can the CPC take advantage of an Amiga technique whereby multiple channels off sync are used to provide > 8 bit audio? or does the audio chip synchronize across the 3 channels?

I know nothing about it on CPC so please excuse my ignorance.
Title: Re: Best Quality Samples possible from CPC
Post by: eto on 08:31, 23 May 23
Quote from: lmimmfn on 00:27, 23 May 23Can the CPC take advantage of an Amiga technique whereby multiple channels off sync are used to provide > 8 bit audio? or does the audio chip synchronize across the 3 channels?

I know nothing about it on CPC so please excuse my ignorance.
yes and no. On other computers that are using the same sound chip or similar ones (like the Atari ST) it's a common "trick" to mix all channels to get from the 4bit logarithmic output for each channel to an (almost) 8bit linear output for all channels combined.

On the CPC this is generally also possible but since the CPC supports stereo output it doesn't mix 3 channels to 1 like the ST does but rather mixes channel 1 with half the volume of channel 2 for one side, and channel 3 with half the volume of channel 2 for the other side. That limits the potential output quality for samples a lot. It's more in the 5bit or maybe 6bit range what you can achieve. I once did the math for this using an Excel table and confirmed with my multimeter that the output levels should work out, but I never followed up on that. But I guess the better sample replay routines already do that anyway.
Title: Re: Best Quality Samples possible from CPC
Post by: STE86 on 14:59, 27 May 23
message from Tony Savona who coded that op demo and many other c64 games featuring samples recently.

" The demo is 1mb (ocean cart), not 16. And that's the whole point of the demo, the music is compressed, not just 48khz"

so, John Ward (atic atac) and myself are looking to maybe convert Fix-It Felix to the amstrad from the c64 version which Tony Savona and myself did.

so we need to know if the Amstrad can cope with the sampled speech in it...

Title: Re: Best Quality Samples possible from CPC
Post by: robcfg on 09:51, 28 May 23
Have you guys listened to the sampled music of Orion Prime?
Title: Re: Best Quality Samples possible from CPC
Post by: andycadley on 10:25, 28 May 23
The Plus machines have three DMA channels that can write to the soundchip at 15kHz. And, in theory they can all write to the same register so you could avoid the stereo issue. Although I've no idea what that would do in terms of audio quality...
Title: Re: Best Quality Samples possible from CPC
Post by: zhulien on 01:50, 03 June 23
Attached are demos08.arc and demos09.arc from CPC Decade converted to dsk for Parados 1.2+ in WinAPE.  For some reason I couldn't get 1.2 or the UniDOS patched parados to read any disc images in WinAPE.

demos08 has an AC-DC sample that should work on an unexpanded 464.  The other samples require 512kb.
Powered by SMFPacks Menu Editor Mod