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.

772 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

waveform tables to allow the dwell time at each wavetable to be variable and<br />

to prevent a long note from "running <strong>of</strong>f the end" <strong>of</strong> the table sequence in<br />

memory. Since a typical instrument used 15-30 waveform tables <strong>of</strong>256 bytes<br />

each, a machine with 64K <strong>of</strong> memory was a distinct advantage. The included<br />

Fourier series routine would allow instruments to be defined in terms <strong>of</strong> linesegment<br />

approximations to the envelope shape <strong>of</strong> each <strong>of</strong> their significant<br />

harmonics. Thus, arbitrary dynamic spectrum variation was provided for,<br />

which allowed surprisingly accurate emulation <strong>of</strong> conventional instrument<br />

sounds as well as a tremendous variety <strong>of</strong> contrived sounds. About the only<br />

defects in the sound produced were a slight background noise level and<br />

occasional clicks on sustained notes in one voice, while the program briefly<br />

stopped sound generation to set up for notes in the other voices. The program<br />

also suffered from the lack <strong>of</strong> a convenient score entry method.<br />

More recently, the Apple Macintosh computer design also includes an<br />

8-bit audio DAC. Besides having the much more powerful 68000 microprocessor<br />

available for computing sound samples, the DAC hardware<br />

repeatedly reads a 370-byte portion <strong>of</strong> memory automatically. A fixed<br />

frequency 22.26-kHz sample clock controls the delivery <strong>of</strong> data to the DAC<br />

rather than the execution time <strong>of</strong> a program loop. The presence <strong>of</strong> this clock<br />

and automatic data transfer circuit greatly simplifies sound-generation<br />

programming as well as solving the click between notes defect noted<br />

previously. In addition to the sample clock, an interrupt is available to signal<br />

when the 370-byte "sound buffer" has been completely scanned out by the<br />

DAC and is wrapping around to be scanned out again. Thus sound<br />

generation can operate on an interrupt basis and appear to be almost<br />

automatic. The interrupt service routine would compute 370 new samples as<br />

quickly as possible and return. Any time remaining from then until the next<br />

interrupt (which occurs 16.7 msec later) would be available for interpreting a<br />

music score, computing new waveform tables on the fly, updating the screen,<br />

and other uses. For example, with six voices and an algorithm similar to Fig.<br />

20-2, a new sample would require about 30 microseconds to compute. To<br />

fill the 370 sample buffer then would require about 11.1 msec to which about<br />

100 f.Lsec <strong>of</strong> interrupt save and restore overhead should be added. This leaves<br />

about 5.5 msec available 60 times per second to perform other tasks.<br />

Although the capability for some truly impressive (for a personal computer)<br />

music generation is there, the author knows <strong>of</strong> no Macintosh music program<br />

that even begins to exploit it.<br />

In 1980, Atari introduced their model 400 and 800 computers, which<br />

were unique at the time for using three custom integrated circuits along with<br />

a much faster than normal 1. 79 MHz 6502 microprocessor. Two <strong>of</strong> these<br />

chips were dedicated to the Atari's video graphics display (Atari was best<br />

known at the time for arcade video games), while the third handled the<br />

alphanumeric keyboard, serial I/O bus, and sound. The sound-generator<br />

portion, which is block diagrammed in Fig. 20-7, probably represents the

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

Saved successfully!

Ooh no, something went wrong!