News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_zhulien

Best sample playback for cpc and plus...

Started by zhulien, 09:53, 16 February 24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zhulien

Hi, does anyone have a best cpc 4 bit or near 4 bit sample playback function for both cpx and plus machines from 8bit data which incan incorporate into the streamer UniDOS node. I only know how to code 1bit sample playback and... I'd rather better.  Thanks

McArti0

CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

McArti0

I'm planning on doing something like this. I get about 6 bits from dithering on 4 PSG bits, but if the resistors are of a different value than in the diagram, and they probably are on each CPC, the result will be different.
CPC 6128, Whole 6128 and Only 6128, with .....
NewPAL v3 for use all 128kB RAM by CRTC as VRAM
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

GUNHED

Also, you can directly use 8 Bit Sample PlayBack. The LambdaSpeak contains an Amdrum emulation - which is in effect an 8 bit sample play engine.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

BSC

I assume you are looking for a pure software-based solution. If you have 8 bit unsigned sample data, you could use the routine by Gasman (attached to the post) to convert the values to 4 bit AY volumes. If the values are signed, you have to convert them before you can use this routine. If you already have 4 bit values, you could just as well send them to the AY as-is and don't need to convert. I think that the best sample playback on the CPC is based on 1) a stable (i.e. each sample is output at exactly the same interval) and 2) a as-high-as-possible playback-rate (to shift aliasing up the frequency band) and 3) using only one AY channel to avoid the cost of switching volume-registers during replay, which has a negative impact on 2). Don't know how the streamer UniDOS node plays into all of this, though. 
** My SID player/tracker AYAY Kaeppttn! on github **  Some CPC music and experiments ** Other music ** More music on scenestream (former nectarine) ** Some shaders ** Some Soundtrakker tunes ** Some tunes in Javascript

My hardware: ** Schneider CPC 464 with colour screen, 64k extension, 3" and 5,25 drives and more ** Amstrad CPC 6128 with M4 board, GreaseWeazle.

Prodatron

#5
Quote from: BSC on 18:28, 17 February 24you could use the routine by Gasman (attached to the post) to convert the values to 4 bit AY volumes.

Here is a shorter version (< 1/3 the size):

;### SMPCNV -> generates table for 8bit unsigned sample playback on a 4bit PSG volume register
;### Input      DE=256byte aligned table
;### Destroyed  AF,B,HL
smpcnvt db 2,3,2,3,4,5,10,11,16,24,23,28,30,36,39,20

smpcnv  xor a
        ld hl,smpcnvt
smpcnv1 ld b,(hl)
smpcnv2 ld (de),a
        inc e
        ret z
        djnz smpcnv2
        inc hl
        inc a
        jr smpcnv1




Quote from: BSC on 18:28, 17 February 24Don't know how the streamer UniDOS node plays into all of this, though. 
Nothing :D

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

zhulien

The streamer unidos node, the purpose is to expose some drivers jn a way that are easy to use through streams. The rom is now on github and is proven to work, but it is far from finished. Currently it has amdrum 8 bit sample playback, it is very basic with a hardcoded bit rate but I will change it to take a versioned header in the stream.

Different devices are grouped as virtual folders within the virtual devices, e.g. audio: device currently has ram music machine and amdrum folders. A simple copy of a sample file to a stream will play it.  The good thing about this approach is that lots of devices can be added without reducing HIMEM and they will be inbthe case of the audio DAC playback, interchangeable.  Ay3892, asic, amdrum, mmachine... whichever hardware the user has, a game for example can write it to the user configured stream.  Likewise with speech, graphics (crtc and v9990 sprite and tile engines, vector graphics too).

I have head cpc sample playback on plus machines and cpcs way beyond the quality my coding has been able, so why not incorporate the best routines where possible in the streamer node.


Powered by SMFPacks Menu Editor Mod