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.

CONTROL SEQUENCE DISPLAY AND EDITING 343<br />

2. Store Xl into port 1 (the coordinate port).<br />

3. Set "store X" and "move X" bits to ones and then zeros to cause an<br />

immediate move to Xl.<br />

4. Store Y I into port 1.<br />

5. Set "move Y" bit to a one then a zero to cause an immediate move to<br />

Yl.<br />

6. Store X2 into port 1.<br />

7. Set "store X" bit on then <strong>of</strong>f to store X2 In the display generator<br />

without affecting the X DAC.<br />

8. Store Y 2 into port 1.<br />

9. Set "move X," "move Y," and "draw" bits on.<br />

10. Wait 50 j-tsec for the line to be drawn.<br />

11. Clear the control port to zeros.<br />

Usually the majority <strong>of</strong> an image is formed by line segments joined end-toend.<br />

In this case, each additional segment after the first only requires Steps 6<br />

to 11 to be executed.<br />

Display List Interpreter<br />

In actual use, a display subroutine would be written that would display<br />

all <strong>of</strong> the line segments.needed for the desired image once and then return. A<br />

display list in memory can specify the line segments in a form that allows<br />

rapid retrieval and display yet easy manipulation <strong>of</strong> the list for editing. The<br />

display subroutine then becomes a display list interpreter executing commands<br />

from the list not unlike a BASIC interpreter. Although considerably more<br />

sophisticated list formats are possible, let us describe one that is simple yet<br />

well suited for this display.<br />

The display list consists <strong>of</strong> individual "list ,elements" strung end to<br />

end. Each element contains an "operation code" byte followed by "operand"<br />

bytes. Code Olt6, for example, will specify a move with the beam <strong>of</strong>f;<br />

therefore, it will be followed by two bytes specifying X,Y coordinates <strong>of</strong> the<br />

destination. Code 02 specifies an isolated line segment; thus, XI,YI and<br />

X2,Y2 will follow as four bytes. For drawing connected line segments, it is<br />

most efficient if they are drawn consecutively. Accordingly, code 03 indicates<br />

that a count byte and a series <strong>of</strong> coordinates follows. A move will be<br />

done to the first coordinate <strong>of</strong> the series and thereafter lines will be drawn<br />

from point to point through the series. The count byte specifies up to 255<br />

lines in the series.<br />

In music synthesis applications, it is common to display graphs in<br />

which one axis, usually X, simply increments for each line in the graph.<br />

Considerable space saving is therefore possible by defining a "graph" segment<br />

type. Code 04 is used to specify a graph. It is followed by a count byte,

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

Saved successfully!

Ooh no, something went wrong!