Hints and tips

Compiling large programs

Bo Hanson
A problem I have often come across is the '! No room' error while using the AMPLE Toolbox compiler with very large programs.
After finishing a tune and adding a title screen and a page or two of 'info' (blurb, waffle etc), there is sufficient memory for the program to run but not enough for the compiler to work, even after deleting all unnecessary modules and words and compacting the program. A full screen title page takes about 1.1K and the compiler needs about 2.2K workspace to knock this down to 0.9K. This may not seem a big saving, but 2K or more can be removed from a large program of 10K or more and this could be enough for the Mixing Desk module to be used. The method below describes how to get around the '! No room' problem. It works, although it is a bit messy.
It is necessary to save the complete song to disc (just in case!), then to split the program into two parts: all the words that are concerned with the music itself in one part and the fancy bits in the other.
*SPOOL the title page(s), info page(s) and RUN to a separate file on disc. Any words that are used by these words must also be included.
For example, if you have two 'info' words, a word to wait for a key press between the 'info' screens, and a title screen word:
"RUN" [ 12#OUT title
"123etc-abc-etc"PLAY ]
"info" [ %blurb...
rtn info2 ]
"info2" [ %more blurb... ]
"title" [ "title information"$OUTNL ]
"rtn" [ REP(#IN13#=)UNTIL()REP ]
These will need to be *SPOOLed to the new file taking care that words which are used in other words are done first (so that they are found when read back in). For example,
*SPOOL newfile
"rtn" TYPE
...
"info2" TYPE
...
"info" TYPE
...
"title" TYPE
...
"RUN" TYPE
...
*SPOOL
After these words have been *SPOOLed, they should be DELETEd from the program:
"RUN" DELETE
"title" DELETE
"info" DELETE
"info2" DELETE
"rtn" DELETE
leaving just the music score, mix(es) and instruments in full.
These are then compiled and *SPOOLed to yet another file on disc:
*SPOOL newfile2
WRITE
...
*SPOOL
Type NEW and *EXEC the file with the title, RUN and info words and then compile these too. Then, the file with the compiled music words can be *EXECed back to give a complete compiled program.
The reason I use *SPOOL and *EXEC rather than using the AMPLE Toolbox MERGE facility is that MERGE will duplicate any existing word names which can create untold hassles when trying to DELETE the unwanted definition of two. Using *SPOOL and *EXEC does away with this problem. Also, it is the easiest way to save just part of a program.
Finally, save the compiled program (I prefix my compiled filenames with a 'C.') and delete the two part files from the disc.
Happy compiling and many saved returns!

Using the Recorder over MIDI

Bernie Dawson
1) The Music 2000 manual does not seem to state that the Recorder works over MIDI provided you put 9 in front of the section letter you allocate.
2) When using MIDI instruments and the Recorder you sometimes want the part you are practising to sound louder than the backing you may have already built up. A convenient way of doing this is to put xxx VEL on the instrument line where xxx is a number up to 127.

Published in AMPLINEX 026, May 1992