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.

678 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

RETURN<br />

OFF<br />

YES<br />

Fig. 18-13. Percussion generator subroutine flowchart<br />

The envelope <strong>of</strong> the filtered noise is handled by higher level routines<br />

just as with the tone generator routine. The damped sine wave generator,<br />

however, supplies its own envelope because <strong>of</strong> the way it works. The activity<br />

flags are used to pass information about the damped wave generator to and<br />

from the calling routine. The start flag is set by the caller when the percussive<br />

sound is to be started. When the percussive routine sees the flag set, it<br />

initializes one <strong>of</strong> the bandpass filter registers (the digital state-variable type is<br />

assumed) to the damped wave amplitude and turns the start flag <strong>of</strong>f. This<br />

operation is equivalent to striking the resonator, and thereafter the filter is<br />

iterated to produce the damped wave.<br />

In theory, the wave amplitude will never reach zero so a mechanism is<br />

necessary to detect when a very small amplitude is reached so that the

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

Saved successfully!

Ooh no, something went wrong!