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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

752<br />

MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

1.0<br />

86 ~SOUND<br />

~FILE<br />

'--,--,..-----'<br />

1.0<br />

Instrument Definition Statements<br />

SET FUNCLENGTH = 8K<br />

INS 0 GENFM; {P5=DUR, P6=AMP, P7=PITCH}<br />

OSC BI P6 P5 F2 D; (AMP ENVELOPE)<br />

OSC B2 1 P5 F3 D; {DEV ENVELOPE}<br />

OSC B3 1 P5 F4 D; {MOD FREQ ENVELOPEl<br />

OSC B5 B2 B3 Fl D; {MODULATION OSCILLATOR}<br />

ADN B6 B5 P7;<br />

OSC 87 81 86 Fl D; (CARRIER OSCILLATOR)<br />

OUT B7;<br />

END;<br />

Fig. 19-17. Generalized FM instrument<br />

Other unit generators, some <strong>of</strong> which are diagrammed in Fig. 19-16,<br />

use similar statement formats. The FLT generator, for example, is a<br />

generalized second-order digital filter (see Chapter 14). It has a signal input<br />

and output, both <strong>of</strong> which are I/O blocks, and five coefficients, which can be<br />

any kind <strong>of</strong> variable or constant. Thus, the filter characteristics can be<br />

specified as constants, parameters in note statements, or by other signals via<br />

the I/O blocks. Also, since arithmetic expressions are allowed in any <strong>of</strong> the<br />

coefficient fields, the FLT statement may be set up for control in familiar<br />

terms such as center frequency and Q factor. FLT also requires four temporary<br />

values for the internal delays, which can be set to any specific initial value or<br />

allowed to default to zero. SNDFILE is not really a generator at all; it instead<br />

reads samples from an existing sound file. The various parameters include an<br />

amplitude factor, an increment for the read pointer (which should be 1.0 to<br />

read every sample), and starting and ending positions in the file. If more<br />

samples are read than exist between start and end positions, the pointer<br />

wraps around to the beginning as if the file was a huge waveform table. The

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

Saved successfully!

Ooh no, something went wrong!