[comp.sys.atari.st] Four voices on a 3 voice soundchip

daniel@hexagon.pkmab.se (Daniel Deimert) (06/30/90)

In article <815@ehviea.ine.philips.nl> leo@ehviea.UUCP (Leo de Wit) writes:
>
>Uh, how do you do 4-channel sound on a 3-channel sound chip? Yes, I
>understand you can quickly change pitches on a channel to simulate a
>second channel, but I think this will sound awful. So how do you do it?

It's even possible to use just _one_ of the soundchip channels, if you
don't care much about "hi-fi" :-)

Seriosly spoken, the basic principle could be described like this:

  a) all sounds are samples -- not "beep"-style (ym/gi soundchip, that is)
  b) play four sounds at the same time, by simply adding them together

  The hard work is to calculate when to play what...  When you
whish to change the frequency of the sound, just play it slower or
faster. This effect can easily be achieved by using tables with true
or false values, which of course are pre-calculated to save time.

  I think there are a few commersial programs on the market that makes
use of this technique.  [ One is from Tommysoft {Germany}, the other
program I know of is from Worksoft {Sweden}.  (Actually, a Swedish
demo-progammer from the more or less known group "SYNC" is the author) ]

Hope this helped you out,
daniel

-- 
Daniel Deimert			   "Only use unneccessary force if neccessary!"
daniel@hexagon.pkmab.se			 ...!sunic!kullmar!pkmab!hexagon!daniel

kgg@zinn.MV.COM (Kenn Goutal) (07/03/90)

Heh heh.  We used to have a program on the PDP-12 (!) that used
this technique to put out two voices on one channel,
complete with the pre-built tables to speed up output.
Actually, I think it was eventually a compiler system
that took in "note files" and wrote out "play files",
and then a player program that just read the "play files"
and dumped them to the speaker.
But I think that at some point it could do it interactively
by using tables.

-- Kenn Goutal

UUCP:	kenn@rr.MV.COM		(...decvax!zinn!rr!kenn)
  or:	kenn@zinn.MV.COM	(...decvax!zinn!kenn)
BIX:	kenn
CompuServe:	71117.2572	(PARTI handle == kenn)
TelePath:	kenn

+-----------------------------------------------------------+
|  Ship and Travel Intermodally -- Commute Electronically!  |
+-----------------------------------------------------------+

hyc@math.lsa.umich.edu (Howard Chu) (07/03/90)

In article <787@zinn.MV.COM> kgg@zinn.MV.COM (Kenn Goutal) writes:
>Heh heh.  We used to have a program on the PDP-12 (!) that used
>this technique to put out two voices on one channel,
>complete with the pre-built tables to speed up output.
>Actually, I think it was eventually a compiler system
>that took in "note files" and wrote out "play files",
>and then a player program that just read the "play files"
>and dumped them to the speaker.
>But I think that at some point it could do it interactively
>by using tables.

I guess a PDP12 beats this story, but I certainly remember this
from my Apple II days. Electric Duet was a lot of fun, before I'd
been exposed to better... (Pokey Player on the 800...  }-)

Y'know, as someone said, by adding the frequency values together
you can encode a pretty cheesy 4 voice sample into a single channel
of the PSG. Well. Given that, why not .... 2 voices per channel on
two channels each, and reserve the 3rd channel for sonic holography
data? Heck, then I'd finally have something cool to use with my
Tweety Board.

(After all, in current hi-fi surround-sound systems, there's only
one channel of sound going to the rear speakers...) Boy, I guess I
really wanna hear what that German 6-voice demo sounds like now.

Could someone please email me details on how I can get hold of these
demo disks? I'm willing to send floppies anywhere for the likes of
this. And if it's doable, I'll have the stuff up on terminator.

Hm..... I guess what we need is a program that reads a bunch of
physical sectors, slams 'em thru a 16 bit compress, and spits out
a file on the other end... And the reverse, of course. Or maybe
tracks. Whatever...
--
  -- Howard Chu @ University of Michigan
  one million data bits stored on a chip, one million bits per chip
	if one of those data bits happens to flip,
		one million data bits stored on the chip...