Hints and tips

Saving memory with default settings

Roger Cawkwell
As the Music 5000 system reads mixes and instrument definitions it makes certain assumptions unless the contents of the mix and instrument words dictate otherwise. For example, every time an instrument is put on a voice, as in
 3 SHARE 1 VOICES Upright
then the volume is set at maximum (128) unless there is a <number> VOL instruction to the contrary.
In the same way, the PAN position is set to the centre (0) unless otherwise instructed.
These are known as the 'default values' and if they happen to be precisely the values you require then you may leave them out. This means, however, that you must forgo the luxury of creating your mix with the Mixing Desk, as it always includes all parameters - but the payoff is increased free memory.
For example, a simple mix (as made in the Mixing Desk) might look something like
M5MIX 48,120=T 0 M5TRANS
1 SHARE 3 VOICES Upright
 1 VOICE 128 VOL -2 PAN
 2 VOICE 128 VOL -1 PAN
 3 VOICE 128 VOL 0 PAN
2 SHARE 2 VOICES
 1 VOICE Drum 128 VOL 0 PAN
 2 VOICE snare 128 VOL 1 PAN
3 SHARE 1 VOICES bovverbass
 1 VOICE 128 VOL 0 PAN
PNUM SHARE
Exactly the same musical effect may be achieved by using Notepad to write
48,120=
T 1SHARE3VOICESUpright
1VOICE-2PAN2VOICE-1PAN
2SHARE2VOICESDrum
2VOICEsnare1PAN
3SHARE1VOICESbovverbass
PNUMSHARE
Not quite so clearly spaced, I admit, but if you're trying to cram in another section and you keep getting the '! No room' error then this inelegant programming will save you, in this case, 111 bytes.
Similarly, the default sound settings for instrument definitions are Hollow, Flat and Onoff - therefore it is pointless including these items. For example,
2 CHANS
1 CHAN
 Pure       Flat       Onoff
 ON RM      1 SHIFT
2 CHAN
 Hollow     Flat       Swell
 -1 POS
EVERY CHAN
% I'm not putting this forward as a recommended definition, by the way!
may be replaced by;
2CHANS
1CHANPureONRM1SHIFT
2CHAN Swell-1POS % Notice the space.
EVERYCHAN        % Can you see why?
with a corresponding saving in memory.
Both the shortened mix and instrument definitions assume that you know what you want - so if you think you might change your mind then make the definitions 'by the book' so that you can mess around with them first in the Mixing Desk and using Notepad's 'panel' facility - then compress them when free space is running low.

Editing 'Too big' files on a Master

Peter Holdroyd
I was faced with trying to edit a word in the program A.MPLINEX, and found that attempts to load Notepad met with a 'Too Big' error indicating that there was not enough memory available.
How to proceed? Having a BBC Master, one of the built-in utilities is a text editor (EDIT), similar in principle to Notepad, but, being a paged ROM, it doesn't take up memory in the way that Notepad does.
The means of using EDIT is a little long-winded but quite straightforward.
If you want to edit a word called 'word' which forms part of a program called 'prog', then, starting in AMPLE, at the '%' prompt type in:
"prog" LOAD <RETURN>
in order to load the program.
Next, type:
 *SPOOL word <RETURN>
"word" TYPE <RETURN>
*SPOOL <RETURN>
*EDIT
<f2>
word <RETURN>
This will write the word definition from AMPLE to a text file and then load this file into EDIT. You can then edit as necessary and resave the text file by typing:
<f3>
word <RETURN>
From EDIT, return to BASIC
<f1>
BASIC <RETURN>
and re-boot your Studio 4000/5000 system disc.
Reload the program, and at the '%' prompt type:
"word" DELETE <RETURN>
*EXEC word <RETURN>
and your edited word will be added to the program. Finally, don't forget to resave the program.

An AMPLE bibliography

Alan Mothersole
This is intended to be an occasional series to act as a cross-reference to articles (other than reviews) published outside AMPLINEX which may be of interest to AMPLE users.
Contributions from readers of other publications would be most welcome to complete the list.
1) Acorn User, April 1987, page 90, 'Sing-Along-A-Micro' by Bob Cornford-Wood includes listing for 'Sunrise-Sunset'
2) Micro User, introductory series to Music 5000 by Ian Waugh:
'Music for Pleasure', August 1988, pages 53-56
'Making Music', September 1988, pages 80-82
'Making the Final Arrangements', October 1988, pages 116-118
3) A&B Computing, November 1988, pages 42-44, 'Juke-Box-Jury' by Allan M Gardner listing for automatic jukebox which will play files from disc in any order any number of times
4) Acorn User, December 1988, page 157, file 'Patapan' by Ian Waugh, included on monthly disc only
5) Micro User, January 1989, pages 135-136, Solution to chord rest bug and automatic RUN error found in release 3 of Studio 5000 disc

Gaps between mixes

G H Richardson
It sometimes happens that the natural sequence of notes and bar endings results in a gap between the end of one mix (or section) and the beginning of the next. The gap is quite logical and correct, but it makes the music sound 'clipped'.
I have found that a solution is to 'trail' a note (usually the last note preceding the last bar line) over into a new bar but to leave that bar without a closing bar line. This means that if played in isolation that note would continue to sound indefinitely unless of course followed by a rest.
In fact, what happens is that the note continues only for its given length or until stopped by the next section or mix. If you were to follow the trailing note with a bar line then, of course, the new section or mix would not start until after the bar line and the result would be a bigger gap.

User port splitter

Jim Brook
I recently bought a user port splitter from Watford Electronics, as I use a Trackerball and the Music 4000 keyboard which both need to be connected to this port and it is a nuisance plugging and unplugging them.
In use, I'm afraid it is not very satisfactory. Pressing a key on the keyboard will frequently, though not always, cause the note to be played two or three times in rapid succession. It has to be caused by the splitter, as removing it, and plugging the Music 4000 directly into the port, cures the problem.

Some short words

Diccon Maude
When entering pieces via the Staff editor, I get very frustrated when, after a piece has been RUN, to play the part on the staff (f1) I have to set up voices for it again.
Therefore, I make this word:
"v" [" VOICES "$+]
and then all I have to do is enter '4vUpright' to set up the voices again.
Also, do remember the word
"lr" [" LOAD RUN"$+]
when making a 'Jukebox' menu, as it is invaluable when you want to include a piece with a long title.

Auto-chaining files – a better method

Bernie Dawson
It is often useful to be able to have auto-chaining files so that when one tune finishes playing the next one will automatically LOAD and RUN. The standard way of doing this is summarised below.
You need the following words in your file:
"next" [ REP(var#?)UNTIL(IDLE)REP ]
"var" [ GVAR ]
"wait" [ REP(QTIME-100#<)UNTIL( IDLE)REP ON var#! ]
Suppose your file '1stprog' has a RUN word like
"1234-ab" PLAY
At the start of 'part1a' enter
OFF var #!
At the end of 'part1b' enter the word 'wait'. Alter RUN to
"RUN" [ "1234-ab" PLAY next $2
        """2ndprog""LOADRUN" ]
What happens is as follows: the master player is held up in the loop 'next' waiting for 'var' to be ON. This only happens at the end of the piece whereupon 2ndprog is then LOADed and RUN.
This has the disadvantage that you are left looking at a title screen, the keyboard cannot be used and neither can the Mixing Desk.
What I have long wanted is to have auto-chaining and the ability to use the Mixing Desk.
Here's how! Forget the above but instead add these words to your file:
"tab" [ &900 138 -12 CODE #2 #2 ]
"chain" [ REP(QTIME-100#<)UNTIL(
          IDLE)REP $2
          """2ndprog""LOADRUN" tab ]
Put 'tab' at the start of 'part1a' and 'chain' at the end of 'part1b'. The 'RUN' word is unaffected.
The way this works is that 'tab' puts a TAB press into the keyboard buffer thus taking you from command mode into the Mixing Desk. At the end of the piece when player 1 encounters 'chain', 'tab' automatically takes you back to command mode along with the instruction to LOAD and RUN '2ndprog'. What you now have is auto-chaining files plus the visual delights and interaction of the Mixing Desk. It works and I'm well chuffed.

AMPLE and MIDI voices on the keyboard

Ken Hughes
If you have both the Music 4000 keyboard and the Music 2000 MIDI interface you can play an AMPLE voice and a MIDI voice together by using the method described in AMPLINEX 008 - playing two AMPLE voices together and changing one of the VOICE names to MIDIV. You must, however, first make a new !BOOT file, since if you try to load 'Keyboard-general sounds' from the 'Jukebox' program after loading AMPLE using the normal Music 2000 !BOOT file, you will get a 'Too many modules' error.
First, insert your Music 2000 disc and before entering AMPLE use
*TYPE !BOOT
to list this file. Next copy this file using *BUILD !BOOT2 except for the two lines:
"M4" INSTALL
and
"INS1"INSTALL
which you should omit.
Now load AMPLE by using *EXEC !BOOT2 and proceed as directed in AMPLINEX 008, using your Music 4000 disc. You may need to type
READY
1 VOICE MIDIV
in command mode to initialise your MIDI instrument. If you wish to use any of the INS1 voices, *SPOOL them out from one of your discs and *EXEC them into your program as a user voice.

INTEGRA-B expansion board

We have received the following information from COMPUTECH of Grange over Sands, Cumbria:
We manufacture the INTEGRA-B expansion for the BBC Model 'B' and following some pressure from one of your members, Patrick Black of Barrow in Furness, and the kind co-operation of Hybrid Technology, we were able to devise a simple change to the !BOOT file of the Music 5000 system disc which will ensure that the INTEGRA-B board provides the requisite support for these programs.
The modification requires insertion of the following commands at the start of the !BOOT file, on the working copy of the system disc, prior to the *BASIC command:
*OSMODE 4 *SHADOW *SHX ON
This will select OSMODE 4, force Shadow mode at the next mode change, and ensure programs end up in the correct memory bank. Following this small change it will be found that all aspects of the programs work as intended when used with the INTEGRA-B system.

Published in AMPLINEX 009, January 1989