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.

686 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

TIME<br />

COUNT ~ a<br />

?<br />

NO<br />

Fig. 18-20. Level 2 general-control routine<br />

This argument specifies how many milliseconds <strong>of</strong> sound to generate before<br />

returning. Although no new events can be started during this interval, any<br />

number may terminate (as mentioned earlier, events are defined by their<br />

starting time and duration). New events can only be created by the NO­<br />

TRAN interpreter when it is in control.<br />

The first task is to scan the memory area devoted to event control<br />

blocks. Every active block found is further tested for the event type and the<br />

corresponding Level 2 generator routine is called. After a complete scan<br />

through all <strong>of</strong> the blocks, 30 samples have been added to the sample buffer<br />

and the buffer address pointers in all sound control blocks have been incremented<br />

by 30.<br />

The next task is to determine if the large sample buffer is full. In the<br />

original implementation <strong>of</strong> NOTRAN, this buffer was 3,000 samples long,<br />

which would therefore hold 100 <strong>of</strong> the small sample blocks. If the large<br />

buffer is full, then a sample record would be written to the mass storage<br />

device. Following this, all <strong>of</strong> the sound control blocks would be scanned and<br />

their sample buffer addresses reset to the beginning <strong>of</strong> the large sample<br />

buffer. While this method <strong>of</strong> handling (he sample buffer seems redundant<br />

(the buffer address field <strong>of</strong> all sound control blocks is the same), keeping the

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

Saved successfully!

Ooh no, something went wrong!