News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_lightforce6128

Multi-channel sample playback

Started by lightforce6128, Today at 03:02

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lightforce6128

This thread is about a technique to play back multiple samples in parallel. A friend who is more interested into another 8-bit system brought this up. But the CPC can do this as well, even better. The idea is simply to mix several samples:

LD H,instrument1 : LD A,(HL)  ;; 4
LD H,instrument2 : ADD A,(HL) ;; 4
LD H,instrument3 : ADD A,(HL) ;; 4
;; ...
INC L                         ;; 1

With this technique easily 10 digital channels can be played in parallel.

The drawback: Frequency and volume are fixed. This means: If the same instrument is needed at three different frequencies, then three samples are needed. While this is unfeasible for some music styles, it might be acceptable for others. E.g. a simple bass line in the background (3-4 samples), continuous strings as support (also 3-4 samples), and synthetic sounds as main melody (8 samples). Also some samples for drums are needed. With a good tracker this would be sufficient to create complex sounds, although by far not every music style can be reproduced with this.

My first question is: Does anybody know if this technique was used somewhere?

The second question is: Does it bring something new? We already have a wide variety of sounds, from default PSG sounds, complex modulations (e.g. the RUN! demo), 1-channel sample playback, up to 3-channel sample playback with adjustable frequency and volume (DigiTracker).

lightforce6128

To do some experiments with samples, I created a RSX that provides several commands to set up and play back samples. To create a sample, additive synthesis is used. This allows to create a sample of 1000s of numbers based on only a few numbers. Although I tried my best to optimize sample creation, it still needs some time. And it needs much memory. Intermediately I even had to use screen memory as buffer. But all is controlled by a few lines of BASIC code what allows easily to do several experiments.

The repository can be found here: https://codeberg.org/lightforce6128/cpc-sample

It contains instructions how to install the RSX and also offers some BASIC programs. The program that builds up an organ-like sound step by step starts with low volume, so the first two iterations may be inaudible.

The extension can use the internal PSG for playback as well as the DigiBlaster on the printer port. What clearly can be noticed is the quantization noise created by the low 4-bit resolution of the PSG. Sometimes it is really annoying, but with other examples it almost vanishes. Until now I did not find out which sounds (besides the default rectangle waves) fit well to the PSG. Are there any experiences?

m_dr_m

Quote from: lightforce6128 on Today at 03:02My first question is: Does anybody know if this technique was used somewhere?
Well digitracker and protracker did such software mixing.

Powered by SMFPacks Menu Editor Mod