Hints and tips

Further notes on 'C.PREPARE'

Allan Gardner
In AMPLINEX 020 Alan Minns showed how Aries Shadow RAM could be utilized without the need to modify the C.PREPARE routine, and for this information I wholeheartedly applaud his method of cracking the problem.
I thought, however, that I could provide some background to the method which I used.
It was late 1986 that I got the Aries B32 (having been told that the Watford Shadow RAM I already had was not compatible with the Hybrid Music System software).
I soon learnt that the Aries board, although compatible, was not being used efficiently.
A study of the Music 5000 User Guide was of little use in solving this problem, and the R, S and K parameters of the C.PREPARE were not explained.
I ended up using a memory editor/disassembler on the PREPARE file and using the extremely limited knowledge that I had at the time of the BBC's internals I managed to find the right 'bits' of the code to alter to get the thing to work more efficiently - and I have not had any real need to change it since.
The method Alan Minns uses to set the Aries static workspace to page &13 necessitates having the link removed from the Aries board - which I would find much less convenient than pressing the Break key once during start up.
One further point, on my use of the term 'PAGE'. Whilst it could be argued that the term OSHWM is more correct I don't think there was any confusion over the meaning intended. Also, even though PAGE has no meaning outside of the BASIC environment, when C.PREPARE is invoked the active language is indeed BASIC, and criticism of the use of this word would seem to be merely pedantic.
One final thought on the subject: in my opinion none of the problems discussed here should ever have existed in the first place. After all, Chris Jordan was the leading light in Aries Computers before forming Hybrid Technology. So we might have expected the two pieces of technology to be perfectly compatible, or at the very least that sufficient information should have been given in the User Guide to make them so.

Changing volume

Neil Walker
Following recent comments about the VOL word, the following 'fade' and 'swell' words may be of interest.
Working through the 'v1' word they will allow volume changes within a note duration.
'fade' fades the volume of a selected voice:
"v1" [ 1 VOICE VOL ]
"fade" [ FOR( #11 COUNT #+ 128 #12 #-
v1 / )FOR #2 ]
'v1' selects a voice - here it is set for 1 VOICE. '128 v1' gives 128 VOL on VOICE 1.
'fade' takes 2 numbers:
- The first is the number of units by which the volume is reduced for each hold (starting from 128)
- The second number defines the number of holds. (If bar length is important, arrange with a ',' setting).
For example:
0:CeGfc 5 16 fade
will produce a 16*5 = 80 reduction in the VOL setting for voice 1 giving 128-80 = 48 as the final value.
'swell' increases the volume of a selected voice:
"v1" [ 1 VOICE VOL ]
"swell" [ #213 #11 v1 #12 FOR( #212
#+ #11 v1 /)FOR #2#2 ]
'swell' takes 3 numbers:
- The first number is the starting volume
- The second number is the number of units by which the volume is increased for each hold (to a maximum of 128). Note: 0 doesn't work
- The third number defines the number of holds. (If bar length is important, arrange with a ',' setting).
For example:
100 #11 v1 0:CEGfc 7 4 swell ^
Before striking a note, set and retain the volume with '#11 v1' as shown above. Use '+L' word to keep the level unchanged at this point (can be done at any previous convenient time).
The 'v1' word could be changed to take 2 numbers, for VOICE and VOL, and/or CHAN rather than VOICE. Try it.

Soloist in trouble

Roger Sapolsky
Suppose you have a music program including a RUN word with a PLAY string such as:
"1234-1abc"
where player 1, owning one or several voices, is the soloist. At a later date, having acquired a MIDI system and Music 2000 MIDI interface, you decide to extend the piece with some new parts to be played by a MIDI instrument.
Logically, the new RUN word will be something like
"12345-19abcdef"
with new words 'part5d', 'part5e' and 'part5f' containing the new MIDI scores. 'part5a', 'part5b' and 'part5c', will be 'empty' (containing an appropriate number of rests). Parts d, e and f on players 2, 3 and 4 just duplicate parts a, b, c.
Well, contrary to all expectations, hiccups interrupt player 5 while it is playing 'part5d' - then the computer hangs up.
After fiddling with the score, I eventually found that the trouble was due to the absence of the 'empty' parts 'part1d', 'part1e' and 'part1f'. Although player 1 is idle after the completion of 'part1c' (and even if the instruction 'UNUSED' has been entered at the end of 'part1c') the system 'expects' player 1's music parts, failing which it stops.
In a AMPLE program, the hitch just described is unlikely, since player1 will probably be given the task of playing the new part after changing the instrument. However, I have found that the hitch is exactly the same when a player 5 is added to 'mix1' to play parts d, e and f.

Easier spooling

Neil Walker
There are some useful words in earlier AMPLINEX issues. 'sp' by David Westbrook (AMPLINEX 003) solves all spooling problems, and I have combined it here with the SHOW word.
"sp" [ "SHOW NL sp1" $+ ]
"sp1" [ 134#OUT
"Word to Spool: "$OUT $IN
LEN1 #- $- $12
$2 """" $12 $+ """" $+
131#OUT "Filename: " $OUT $IN
"*Spool S." $+ $+ "TYPE" $12
$+ "*SPOOL" $12 $+ $+ ]
To save this utility, start a new program (NEW), type in the words as shown above, then type:
*SPOOL sp
WRITE
*SPOOL
To use 'sp' from disc type:
*EXEC sp
Then when you need to save a word type 'sp' and away you go.

Published in AMPLINEX 021, March 1991