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.

312 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

an output pointer designates the first slot that contains valid data. If both<br />

pointers point to the same slot, the queue is empty and no data is available.<br />

After a deposit or withdrawal from the queue, the pointers are incremented<br />

by four, since each event requires four bytes. Wraparound <strong>of</strong> the circular<br />

queue from end to beginning is implemented by masking the queue pointers<br />

so that they can never contain a value larger than 31. No test is made for a<br />

full queue so if more than seven events are stacked up due to nonresponse<br />

from the host, they will be lost, Timer interrupts are disabled during queue<br />

operations, but since the timer is an oscillator, no timing errors accumulate.<br />

Actual scanning <strong>of</strong> the keyboard is slightly unconventional due to the<br />

need for high speed. Since the vast majority <strong>of</strong> keys will be inactive, the scan<br />

loop is made as efficient as possible for that case. Also the scanning loop is<br />

expanded by a factor <strong>of</strong> four to decrease the time per key from 15 JLsec to an<br />

average <strong>of</strong> 12.25 JLsec for a total savings <strong>of</strong> 167 JLsec. Any key that is not<br />

both in State 0 and contacting the upper bus causes a vector jump to the<br />

approptiate processing routine, which is based on the 2-bit state code kept<br />

for each key. Since a vector jump is used to get to the processing routine,<br />

returning to the proper point in the expanded scan loop is a little tricky but<br />

quite fast. The state processing routines themselves simply implement the<br />

state diagram <strong>of</strong> Fig. 9--8. Note the convenience <strong>of</strong> indexed addressing where<br />

the key number currently being considered is always kept in the Y register<br />

and can be used to directly access contact status as well as the state byte for the<br />

current key.<br />

MIDI<br />

One <strong>of</strong> the centtal issues raised by the use <strong>of</strong> a separate keyboard<br />

microprocessor is the communication <strong>of</strong> keystroke data between the keyboard<br />

and the synthesizer's processor. The method just described is highly efficient<br />

and cost-effective when both ends <strong>of</strong> the intetface (the keyboatd and the<br />

synthesizer) are under the builder's control. The same would be the case with<br />

a manufacturer <strong>of</strong> keyboard-driven, microprocessor-controlled synthesizers<br />

who makes both the keyboard and the synthesizer. Of course, in these cases,<br />

each interface and data format design would probably be different as the<br />

designer attempts to optimize cost and performance to the problem at hand.<br />

Recently, however, users <strong>of</strong> commercial keyboard synthesizers have<br />

shown increased interest in connecting them together so that keystrokes on<br />

one synthesizer could also trigger sounds in anothet synthesizer ftom a<br />

different manufacturer. Additionally, a demand has developed for keyboards<br />

purchasable separately from the synthesizer and keyboardless "expander"<br />

synthesizers that can increase the numbet <strong>of</strong> voices available from a stock<br />

synthesizer. Separate digital sequencers capable <strong>of</strong> recording a sequence<br />

directly from a keyboard and later playing it through a synthesizer have also<br />

become available. Many owners <strong>of</strong> personal microcomputers would like to

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

Saved successfully!

Ooh no, something went wrong!