22.09.2015 Views

of Microprocessors

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DIRECT COMPUTER SYNTHESIS METHODS 117<br />

given above. Thus, amplitude envelopes, amplitude modulation, and frequency<br />

modulation are all very easily accomplished.<br />

Other waveshapes may be easily computed even though a built-in<br />

function for the desired shape is not provided by the computer's programming<br />

language. A sawtooth wave, for example, is defined by the expression<br />

where the mod function gives only the remainder when the expression to its<br />

left is divided by the expression to its right. A triangle wave may be formed<br />

from sawtooth samples by ~pplying<br />

Sn TRI = 2A TR ! ( ISiJSAI\" I - A~w )<br />

One must be careful when directly computing complex waveshapes<br />

with sharp corners and vertical lines because alias distortion can occur. When<br />

these waves are computed, they are computed perfectly with all <strong>of</strong> their<br />

harmonics up to infinity. However, those harmonics that exceed half the<br />

sample rate will be reflected back down into the audible spectrum and cause<br />

distOrtion. The problem is generally not severe as long as these waveforms are<br />

held to low frequencies, but it does prevent use <strong>of</strong> these shapes as fundamental<br />

basis waves such as is done in the voltage-controlled synthesizer.<br />

Fourier Series<br />

Probably the most flexible method <strong>of</strong> generating waveshapes by computer<br />

is to use the Fourier series. Individual sine wave harmonic (or specific<br />

nonharmonic) frequencies can be compuced at selected phase angles and<br />

amplitudes and summed together to produce a composite waveform. Any<br />

problem with alias distOrtion due to high harmonics is circumvented by<br />

simply omitting those that exceed half the sample rate from the calculation.<br />

Of course, the amplitudes <strong>of</strong> individual components may be continuously<br />

varied for a changing spectrum shape. The effect <strong>of</strong> a filter with any arbitrary<br />

frequency response may be simulated by multiplying each harmonic<br />

amplitude by the filter response curve amplitude at the corresponding frequency.<br />

Simultaneous Sounds<br />

Simultaneous sounds are easily done by computing the string <strong>of</strong> samples<br />

for each sound and then simply adding the strings <strong>of</strong> samples together to<br />

get one string for the composite sound. Fortunately, the same effect is<br />

realized if one sample for each sound is computed and then the samples are

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!