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.

MUSIC SYNTHESIS SOFTWARE 645<br />

operating system. The latter defect in turn begat a variety <strong>of</strong> incompatible<br />

solutions to the problem. Although Modula-2 has addressed this in the<br />

language specification, it is probably too late to help.<br />

C is another structured language born in the commercial world and is<br />

probably the most used in large microcomputer s<strong>of</strong>tware projects. It was<br />

developed at Bell Laboratories and is <strong>of</strong>ten seen in conjunction with UNIX, a<br />

very large time-sharing operating system (UNIX is in fact written in C). It is<br />

available as a stand-alone language for most microcomputer systems from the<br />

Z-80 and 6502 up to the 68000. In fact, a large and comprehensive delayed<br />

playback music synthesis system written in C (the CARL project at UCSD) is<br />

readily available and will be described in the next chapter. As mentioned in<br />

Chapter 5, C has structural features that allow for highly efficient object code<br />

generation-if the compiler takes advantage <strong>of</strong> them. In particular, the<br />

68000 is a good match for the requirements <strong>of</strong> C because <strong>of</strong> its unsegmented<br />

memory addressing and numerous registers capable <strong>of</strong> holding 32-bit<br />

"double" values. The sos6 family (SOSS, SOlS6, S02S6) is not as good<br />

because <strong>of</strong> the lack <strong>of</strong> those same features. In particular, their segmented<br />

addressing will either impose a 64K limit on the size <strong>of</strong> arrays, which could<br />

be a problem in musical applications, or will exact a severe space and time<br />

penalty if the compiler attempts to overcome it. A big advantage <strong>of</strong> C is that<br />

I/O and system call conventions are written into the language specification<br />

and thus differ little from one implementation to the next. A potential<br />

drawback <strong>of</strong> C is its <strong>of</strong>ten cryptic appearance, which makes adequate<br />

comments in programs essential.<br />

One programming language property that is taking on increasing<br />

significance is portability. At the current rate <strong>of</strong> microprocessor evolution, it<br />

is quite likely that the computer being used will become obsolete in the<br />

course <strong>of</strong> music system development (this has happened three times to the<br />

author). Parts <strong>of</strong> the system implemented in a high-level language should be<br />

easily transportable to a new system if required. C promises to be very good<br />

in this respect. Although the low-level assembly language routines are not<br />

portable, they can usually be kept small, thus minimizing the effort needed<br />

to reimplement them on different hardware.<br />

Low-Level Programming Techniques<br />

Because they are executed so much, low-level sample computation<br />

routines completely dominate the speed characteristics <strong>of</strong> a direct computer<br />

synthesis system. Arithmetic operations in turn dominate the execution time<br />

<strong>of</strong> these low-level routines, particularly on a microcomputer. This is in stark<br />

contrast with most general-purpose assembly level programming in which<br />

arithmetic instructions are among the least used. Unless the reader has access<br />

to a mainframe or supermicrocomputer with floating-point hardware, it is a<br />

sure bet that these arithmetic operations will be <strong>of</strong> the fixed-point variety.

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

Saved successfully!

Ooh no, something went wrong!