[comp.music] Additive Synthesis

umbirch2@ccu.umanitoba.ca (Robert Birch) (11/05/90)

   I am currently working on writing a new music program. What I would like to
do is add two different waveforms together to similuate more than one voice per
voice (at least 2 voice per channel). Can someone explain to me how to do this,
or better yet give me some example code on how this can be done (C or Assembly
is preferred but any language is OK)?

                                           Thanks, Robert Birch
                                           <umbirch2@ccu.umanitoba.ca>

a577@mindlink.UUCP (Curt Sampson) (11/06/90)

> umbirch2@ccu.umanitoba.ca writes:
> 
>   I may not have been as clear on this as I thought. I want to take two
> completely different waveforms playing different notes and combine them
> into one waveform playing both notes at there proper pitches with the right
> sound.

It's surprisingly simple, actually.  Just add the two waveforms together,
sample by sample.  You may then have to scale the result, though, as adding two
full code words will cause an overflow.  This is easily done by shifting your
output n bits right after adding 2^n voices, e.g., in a four bit system adding
two full code words (1111) will produce 11110, which becomes 1111 after being
shifted to the right.

cjs
--
Curt_Sampson@mindlink.UUCP                     (Vancouver, B.C., Canada)
{uunet|ubc-cs}!van-bc!rsoft!mindlink!Curt_Sampson
curt@cynic.wimsey.bc.ca                            BBS: +1 604 687 6736

maverick@fir.Berkeley.EDU (Vance Maverick) (11/06/90)

	If I read you right, you're asking "How do I make a bunch of partials
sound like two notes at the same pitch?"  Well, there are several cues
we use to fuse partials together into a single tone-percept.
	One of these is the harmonic-series property, which will obviously hold
for all the partials if you're doing straight naive additive synthesis. 
The chorus effect on the Synclavier (and doubtless other additive
systems) is created by a second set of harmonics, all based on a
fundamental at some ratio to the nominal fundamental of the note you
play.  To my ear, this sounds less like a doubling than like a fattening.
	There's another cue you can use, which Stephen McAdams calls
"micromodulation":  suppose you pick a random bunch of sine tones.  They
won't sound like much if they just play steadily, but if you impose on
them all the same faint frequency wobble (multiplicative in frequency),
they will group together much more strongly.  So if you have two
identical sets of harmonics, but impose on them two different wobbles,
you can cause them to group into two notes.  Check Stephen Handel's book
"Listening" for more of this material, and some advice on frequency and
degree of modulation.

	-- Vance

umbirch2@ccu.umanitoba.ca (Robert Birch) (11/06/90)

In article <8528@pasteur.Berkeley.EDU> maverick@fir.Berkeley.EDU (Vance Maverick) writes:
>
>	If I read you right, you're asking "How do I make a bunch of partials
>sound like two notes at the same pitch?"  Well, there are several cues
>we use to fuse partials together into a single tone-percept.
>	One of these is the harmonic-series property, which will obviously hold
>for all the partials if you're doing straight naive additive synthesis. 
>The chorus effect on the Synclavier (and doubtless other additive
>systems) is created by a second set of harmonics, all based on a
>fundamental at some ratio to the nominal fundamental of the note you
>play.  To my ear, this sounds less like a doubling than like a fattening.
>	There's another cue you can use, which Stephen McAdams calls
>"micromodulation":  suppose you pick a random bunch of sine tones.  They
>won't sound like much if they just play steadily, but if you impose on
>them all the same faint frequency wobble (multiplicative in frequency),
>they will group together much more strongly.  So if you have two
>identical sets of harmonics, but impose on them two different wobbles,
>you can cause them to group into two notes.  Check Stephen Handel's book
>"Listening" for more of this material, and some advice on frequency and
>degree of modulation.
>
>	-- Vance

  I may not have been as clear on this as I thought. I want to take two 
completely different waveforms playing different notes and combine them
into one waveform playing both notes at there proper pitches with the right
sound. For example, have a piano playing a C, and a violin playing a G, and
getting both sounds to come out of on channel (or voice). I hope this clears 
things up.

                                             Robert Birch
                                             <umbirch2@ccu.umanitoba.ca>