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.

330 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

Figure 10-7 shows rhe effect <strong>of</strong> sampling a low-frequency square wave<br />

with such a degraded SAH. The output is a series <strong>of</strong> rising and falling<br />

arpeggios, but the pitch intervals start large and then decrease after each<br />

direction reversal. Altering the series resistor changes the step size and rate <strong>of</strong><br />

interval decrease considerably. The effect on sampled white noise is also<br />

interesting. As the resistor is increased, the random output changes from<br />

total disorder toward a more correlated result. Unfortunately, the standard<br />

deviation also decreases, which would have to be counteracted with a VCA in<br />

a practical application. Obviously, voltage control <strong>of</strong> slew limiting would be<br />

a useful SAH feature.<br />

Controlling Randomness<br />

As was mentioned, a slew-limited SAH module is capable <strong>of</strong> imparting<br />

a degree <strong>of</strong> order in random sequences. Actually, it is possible to get exactly<br />

the same results by passing the signal to be sampled through a single-pole<br />

R-C low-pass filter first. If white noise is to be sampled, then this amounts to<br />

filtering the noise. The slew-limited SAH module is actually a discrete-time<br />

low-pass filter, which is the first step toward a digital filter!<br />

A sequence <strong>of</strong> random numbers is actually sampled white noise. Thus,<br />

one can easily write a program to simulate analog sampling <strong>of</strong> white noise by<br />

using the RND (random number) function available in the BASIC programming<br />

language. If a synthesizer is interfaced to the computer, then<br />

random numbers can.be fed to an oscillator to produce the same kinds <strong>of</strong> note<br />

sequences available with analog setups. One point to be aware <strong>of</strong> is that most<br />

random number generators have a uniform probability distribution, generally<br />

between 0.0 and 1.0. A good approximation to a gaussian distribution may<br />

be had by adding up 12 random numbers (distributed uniformly between 0.0<br />

and 1.0) and subtracting 6.0 from the sum. The mean <strong>of</strong> the result will be 0<br />

and the standard deviation will be 1.0.<br />

The name "stochastic music" refers to music (melodies) that orginates<br />

from sequences <strong>of</strong> random numbers. It should be apparent that raw random<br />

numbers, regardless <strong>of</strong> the probability distribution function, would create<br />

rather uninteresting music. Each note is an independent entity, with no<br />

relation to what came before and no influence on what follows.<br />

A very simple algorithm can be applied to a random sequence, however,<br />

to produce a highly correlated sequence that might be more interesting.<br />

The basic idea is to use random numbers to determine the direction and<br />

magnitude <strong>of</strong> pitch movement rather than the pitches themselves. As a simple<br />

example, let's say that the pitches are to be notes on the chromatic equaltempered<br />

scale and that the maximum allowable interval between successive<br />

notes is an octave. Thus, a sequence <strong>of</strong> random integers falling between -12<br />

and +12 inclusive is needed. The BASIC expression INT(25*RND(I»<br />

-12 will produce such a sequence. To produce a note sequence, numbers

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

Saved successfully!

Ooh no, something went wrong!