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.

MUSIC SYNTHESIS SOFTWARE 697<br />

However, if a period <strong>of</strong> silence is needed, a statement having a lone rest<br />

specification can be used.<br />

Figure 18-23 shows some common musical situations and how they<br />

might be coded in NOTRAN. This sequencing method is quite general and<br />

should be able to handle any situation likely to be encountered in reasonably<br />

conventional scores.<br />

Level 3 Routines<br />

The primary function <strong>of</strong> Level 3 s<strong>of</strong>tware is to decode the NOTRAN<br />

statements that were just described and extract their information content.<br />

Conversely, if a typing or specification error is found, the condition should<br />

be reported to the user. The routines for statement scanning and syntax<br />

checking, however, are in the realm <strong>of</strong> compilers and other language analysis<br />

programs and are therefore beyond the scope <strong>of</strong> this text. Basic NOTRAN as<br />

specified here is very simple in comparison with a typical programming<br />

language; thus, a statement interpreter should not be very difficult to write<br />

even by one experienced in general programming but inexperienced in compilers.<br />

In fact, a successful interpreter can be written with no knowledge <strong>of</strong><br />

classic compiler theory at all, just common sense. The main danger, however,<br />

is a program that might misinterpret an erroneous statement rather<br />

than flag it as an errot.<br />

Once a statement is decoded, its information content is systematically<br />

stored in tables. In the case <strong>of</strong> a voice statement, for example, the various<br />

envelope parameters are stored in a table that describes the characteristics <strong>of</strong><br />

that voice. The waveform parameters are then used to compute a waveform<br />

table (or tables) that is stored away, and a pointer to the table is stored along<br />

with the envelope parameters. The voice 10 is also part <strong>of</strong> these data. Before<br />

allocating additional table space, a scan is performed to determine if the same<br />

voice 10 had been defined previously. If so, the new information replaces the<br />

old; otherwise, more table space is allocated. Percussive voice definitions are<br />

handled in the same way except that the parameters are different and no<br />

waveform table is needed. TEMPO statements simply update a single tempo<br />

variable, which then influences all succeeding time calculations.<br />

When an actual event is encountered in a note statement, several<br />

operations must be performed. First, the voice 10 is extracted and used to<br />

locate the table <strong>of</strong> information created earlier when the corresponding voice<br />

statement was processed. Next, a new event control block (ECB) is created<br />

(by scanning the control block area until an inactive one is found), and<br />

pertinent information such as waveform table addresses and envelope<br />

parameters are copied over to it. The frequency parameter in the ECB is set<br />

by further scanning the specification for pitch information. Next, the duration<br />

and articulation specifications are analyzed and the information used in<br />

conjunction with the tempo variable to set the sustain duration. Finally, the<br />

duration is compared with the current "shortest duration," which is updated

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

Saved successfully!

Ooh no, something went wrong!