Showing posts with label Utilities. Show all posts
Showing posts with label Utilities. Show all posts

Korg M3R remote editing utility

% by Bernie Dawson
% For more details see U.M3Rinfo
% Published by AMPLINEX September 1992
"7bit" []  "lev" []  "mdesk" []
"prg" []
"7bit" [&3FFF AND
#11
&7F AND MIDIOUT
128 #/ #2
MIDIOUT
]
"lev" [1 VOICE
 &41 &24 &3F &42 &F0
6 FOR( MIDIOUT )FOR
 7bit
&F7 MIDIOUT
]
"mdesk" [%  prog          level
    11  1 prg      80   2 lev
    21 15 prg      60  16 lev
    21 29 prg      70  30 lev
     1 43 prg      70  44 lev
     1 57 prg      70  58 lev
     1 71 prg      60  72 lev
    12 85 prg      80  86 lev
     4 99 prg      71 100 lev
]
"prg" [1 VOICE
 &41 &24 &3F &42 &F0
6 FOR( MIDIOUT )FOR
1 #+   7bit
&F7 MIDIOUT
]

Published in AMPLINEX 028, September 1992

Remote editing of the Korg M3R

Bernie Dawson
Although this utility is written for the Korg M3R it can be easily adapted for other synthesisers.
When I grew tired of the Music 5000 sounds I expanded via the Music 2000 route and got into MIDI. I bought the M3R expander unit. This is a rack-mount 16-voice polyphonic multitimbral synthesiser. On this synthesiser, instruments are arranged as 'programs', and these are combined into a 'combination'. Roughly speaking this equates to instruments and a mix on the Music 5000. While the factory sounds are very good, it wasn't long before I wanted to alter them.
Unfortunately, like most digital synthesisers, access to programming the sounds is via a few buttons next to a tiny 16 x 2 display. On a rackmount unit this is on a vertical face, the wrong angle for your fingers. When you consider that there are something like 60 different parameters that can be altered for just one sound, it can involve a lot of button pushing!
Pining for the instrument panel approach of Notepad I therefore decided to have a go at writing a remote editor. This involved understanding a little about the nature of MIDI messages, which are of two types. Channel messages convey note information (which note, note on, note off, velocity, etc). System exclusive (sysex) messages can do much more, including changing the sound parameters. The Music 2000 manual was particularly helpful and a few frustrating nights in the back of the M3R manual eventually brought forth success. The following is an example of a sysex message:
&F0 begin sysex message
&42 KORG ID
&3n n + 1 = MIDICHANNEL number
&24 M3R ID
35 Parameter number for filter cutoff
29 new value to be used
&F7 end sysex message
Thus in the above example the instrument being edited in the M3R would have its filter cut-off value altered to 29. On any other synthesiser it is a matter of substituting the middle bytes, which will involve you delving into the back of your own synthesiser's manual! Each byte is sent out using MIDIOUT. Data values have to be processed to a 7 bit format since the MIDI specification lays down that data bytes have bit 7 = 0. This is done within the program by the word '7bit' which I got from the Music 2000 manual. The rest you can suss out by analysing the program words.
It is no good doing this unless your synthesiser is set up to receive the messages. In particular you need to ensure that the synthesiser receives on the same channel as you are sending, that program changes are not disabled and that sysex messages are enabled! Check out the 'info' within the program.

Program editing

To start the editor, LOAD it in, get 'panel' into Notepad and follow the instructions. You will see the block cursor blinking on 'progch'. Hold down shift and alternative instrument pages are presented. This works because each instrument page starts with a null word I've defined, 'INSPAGE'. This is one of Hybrid's rules and is how the program knows which alternatives exist. To go into an instrument page, press the space bar. This is exactly equivalent to choosing a Music 5000 instrument and then accessing the instrument panel.
I never realised the panel form of Notepad was so flexible until I wrote this utility. I can now change sounds on my M3R in an analogous manner to changing Music 5000 sounds. The Return key, or the Music 4000 keyboard allows me to hear the results of the alterations.
The one disadvantage of my utility is that the communication is one-way, BBC to M3R, so I have copied one program's parameters (Analog 2) as the starting-off point for sound alteration. This cannot be solved without knowing how to use the MIDI IN of the Music 2000 interface, for which the manual gives no information.

Combination editing

This (U.M3Rexec) is a short file which should be EXECed in to a music file. It proved a simple matter to adapt the program editing approach to write a combination editor. I have stopped at an elementary Mixing Desk approach. Start up a piece and enter 1 SHARE, then call up 'mdesk' in Notepad. Again, press f2 to go into panel mode and you can then alter the choice of programs or their relative volumes. This is analogous to the Mixing Desk of the Music 5000 and again means that alterations can be done remotely, from the BBC, without loads of button pushing.

Related files on this disc:
U.M3Rprog - Remote editing program for the Korg M3R synthesiser
U.M3Rexec - EXEC version of the remote editing utility

Published in AMPLINEX 028, September 1992

Automatically repeating menu choices

Tony Walduck
While writing a menu-based utility (the violin scales and arpeggios program also featured in this issue) I wished to make it possible to easily repeat a menu selection after it had been acted upon. These notes describe the solution I developed.
I decided to allow the automatic reselection of a previous menu choice by putting a repeat option as the first menu line.
All other menu lines write a number into a GVAR variable as well as actioning their intended response. The number written is the number of down-key presses needed to position the highlight on that menu line.
The repeat menu option reads the GVAR variable, flushes the keyboard input buffer (*FX15,1) and, if the variable is not zero (which would cause it to loop), inserts that number of down-key codes into the input buffer (*FX138), followed by a Return code to re-select the previous menu line.
The program U.VSA (Violin scales and arpeggios - accessible from this Utilities menu) contains a much-modified version of this technique. In this one program, nearly 80 music pieces can be chosen and easily repeated.
The reason the technique has been modified is that, as I rapidly came to the 125 user-word limit as well as space limitations, I had to employ whatever constructions would allow me to economise on both. Consequently the program structure is less clear than I would have liked it to be.

Related files on this disc:
U.Repeat1 - example repeat menu facility for a single-level menu
U.Repeat2 - as above for a two-level menu

Published in AMPLINEX 027, July 1992

Violin scales and arpeggios

Tony Walduck
This program gives access to nearly 80 scales, arpeggios and sevenths for the Royal School of Music violin grades 1 to 5. No slurring or bowing patterns are given - the sole purpose is to give help with pitch and timing.
For each piece, a few drum beats give a lead-in - the number is shown <n> on the relevant menu. Also, a piece, once chosen, can be repeated easily (just by pressing Return).
Some of the higher grades use the same scales as a lower grade (but with a different bowing pattern). Up to grade 4 these 'duplicate' scales are shown (within parentheses), and the earlier grade menu is displayed. At grade 5 this is not done (lack of word-space; and grade 5 candidates ought to be generally proficient anyway).
Notes:
For the convenience of my own children, the grade 1 2-octave scales are re-directed up to the grade 2 menus.
I have tried to provide full support to a keyboard, but this only becomes fully operational (8-key) when the pieces finish.

Related file on this disc:
F.VSA - Violin scales and arpeggios program

Published in AMPLINEX 027, July 1992

Getting Toolbox editors on the menu

Allan Gardner
As a user of the AMPLE Toolbox utilities I wanted to incorporate the Toolbox editors into the AMPLE 'main menu'.
I decided that there were some entries in the menu that I rarely used. (I should say at this point that I use the same M.MENU module whether I intend to use Music 4000 or not, by including or missing out the installation of M.M4 in the !BOOT file - see 'Separating AMPLE modules' utility in AMPLINEX 024).
If I am not using the Music 4000 I overlay the 'Keyboard', 'Recorder' and 'Ready system' items in the menu with a short file (generated with a memory editor), containing entries with 'Text Edit', 'Image Edit' and 'Utils'. If I do intend to use the Music 4000 I overlay the 'Ready system', 'Load' and 'Save' options with another file containing the patch to produce the TEDIT, IEDIT and UTILS options.
To generate the patch file it is necessary to do some memory searching on a normally-configured system. Once the M.MENU module has been INSTALLed it is modified by the system, so any patch generated will only work if the system is configured in a consistent manner (i.e. modules INSTALLed in the same order each time - not normally a problem).
Once you have located M.MENU in memory (some things to look for are 'MENUDISP', '"MDELETE', 'Mixing Desk' or '"MIX"') you need to find the page at which it starts, as this page is written into the module at various locations (about 40) on INSTALLation, and this page number will probably need to be incorporated into your patch.
An example entry in the MENU would contain the following bytes:
0E begin string (i.e. tokenised ")
09 length of following string **
54 T
65 e
78 x
74 t
20 space
45 E
64 d
69 i
74 t
0E end of string?
09 don't know - but 09 works & 0C removes entry from MENU
22 " (not tokenised)
54 T
45 E
44 D
49 I
54 T
22 " (not tokenised)
8B ) these four tokens appear
90 ) to MDELETE any temporary
11 ) module already loaded,
50 ) followed by "TEDIT"MLOAD TEDIT
37 page where start of M.MENU module is located
   (at location &3700 in this case)
** By careful choice of the string length of the new MENU entries, the patch can (and must) be designed to exactly overlay the original entries - no gaps or overlaps allowed!
In the !BOOT file you should include the line to *LOAD the patch file after the modules have been loaded, but before the 'MAIN' command.
One (slight) problem is that the M.UTILS module does not have a 'UTILS' word defined, so:
"UTILS" MLOAD UTILS
(as performed by the menu selection) will MLOAD the module correctly but will then give a '!Mistake' error.
To alleviate this problem I have added the following two lines to my !BOOT file, again just before the 'MAIN' command.
"UTILS" [ """UTILS""MSHOW"$+ ]
*K.7"LOAD"UTILS"["""UTILS""MSH."$+]|M
The first line defines the word 'UTILS' so that the available utilities are shown after the module is loaded, and the second line adds the same word to the '"LOAD' definition of function key 7.
In summary, I will admit that it is quite messy to implement, but once it has been done it is most satisfying to see, and be able to use, the Toolbox editors in the main menu.

Published in AMPLINEX 025, March 1992

AMPLE modules in new system releases

Allan Gardner
There have been several hints, tips and enquiries recently regarding the latest releases of Hybrid Technology system discs where some of the modules are combined into one file with the name M.!SYSTEM.
I have encountered several problems:
- the Watford DFS (1.44) is not compatible with building a system disc from an issue disc, although it is perfectly alright once the system has been built
- the C.PREPARE file which I had previously modified to use Shadow RAM was no longer compatible with the modules M.INT, M.M5, M.M4, M.EW, M.MENU, M.FX1A and M.INS1 which are now 'lumped' into M.!SYSTEM
- with M.!SYSTEM you cannot leave any of the above modules (e.g. M.M4 or M.MENU) out of the system to save memory
- Martijn van der Mei's excellent utility (AMPLINEX 021) to allow AMPLE modules to be held in Sideways RAM appears to accept the combined module, but does not subsequently work.
Clearly something radical was called for, so I set about trying to break down M.!SYSTEM into its constituent modules.
Firstly, I analysed all of the modules I had, scattered around several system discs, ranging from a Music 5000 Release 1 to the latest Music 5000-4D-3, (which includes the M.M5 and M.MIX modules for the Music 3000 expander). I was thus able to find the latest versions of each module and which ones had not changed since they were available separately (before M.!SYSTEM).
Then, armed with a memory editor, I was able to identify the individual modules within M.!SYSTEM (not too easy if you have not got an individual copy with the same version number) and then save them back to disc.
I now have a system disc with all of the individual modules (including the three from AMPLE Toolbox) available separately for custom installation.
A short BASIC program was used to separate the modules from M.!SYSTEM and this is shown below (and a copy is included on this disc).
10 HIMEM=TOP+&200 : I%=HIMEM
20 PRINT"Loading.. M.!SYSTEM at ";~I%
30 OSCLI("LOAD M.!SYSTEM "+STR$~(I%))
40 REPEAT
50 Names$="M."+$I%
60 Start$=" "+STR$~(HIMEM+?(I%+7)+ ?(I%+8)*&100)
70 End$=" "+STR$~(HIMEM+?(I%+16)+ ?(I%+17)*&100)
80 A$=Names$+Start$+End$+" 10 0"
90 PRINT"Saving.. "A$
100 OSCLI("SAVE "+A$)
110 I%=I%+9
120 UNTIL !I%=0
130 END
Once I had a disc which contained every module it was a simple job to write a BASIC start-up program to provide a menu of the likely combinations of modules I would need:
10 MODE7
20 PRINT'"Hybrid Technology Music System"
30 PRINT'"1. Basic M5000 System"
40 PRINT'"2. Basic M4000 System"
50 PRINT'"3. M5000 System with Text Editor"
60 PRINT'"4. M4000 System with Text Editor"
70 PRINT'"5. M5000 System with Mode 7 Editor"
80 PRINT'"6. M4000 System with Mode 7 Editor"
90 PRINT'"7. M5000 System with UTILS"
100 PRINT'"8. M4000 System with UTILS"
105 PRINT'"9. M5000 Minimum System"
110 PRINT'"(please note all options"
111 PRINT" support M3000 expander)"
112 REM only if you have M3000 versions of M5 & MIX
120 PRINT'"Please select (1-9) ";
130 A=GET:IF A=13 THEN A=49
140 A=A-48:IF A<1 OR A>9 THEN 10
150 PRINT;A
160 FOR I=1 TO A
170 READ F$
180 NEXT
190 A$="EXEC "+F$
200 OSCLI A$
210 END
220 DATA M5000,M4000,M5000T,M4000T
230 DATA M50007,M40007,M5000U,M4000U
240 DATA M5000M
An EXEC file for all of the modules was written (based on the original !BOOT file of early copies of the system disc), and then several copies were saved on to disc with various modules REMmed out (with %).
The basic start-up program then merely *EXECs the relevant option file. For instance, the example below was used for the 'normal' Music 5000 start-up.
*BASIC
*/C.PREP R S K
*FX 202,48
*FX118
*AMPLE
*TV0,1
":0.M." MPREFIX
"INT" INSTALL
"M5" INSTALL
% "M4" INSTALL
"EW" INSTALL
"MENU" INSTALL
"FX1A" INSTALL
"INS1" INSTALL
% "TEDIT" INSTALL
% "IEDIT" INSTALL
% "UTILS" INSTALL
MAIN
Other EXEC files have M4, TEDIT etc. included and one is a minimized system having MENU and MAIN removed.
Thus I am now able to use any of the modules at will and be able to use Shadow RAM, and all from one disc.

Related file on this disc:
U.ModuSep - BASIC program to separate the individual modules from the M.!SYSTEM file.
Note that before running this program you must have a disc containing the M.!SYSTEM file in the default drive and enough space on the disc to write out the seven resulting module files.

Published in AMPLINEX 024, January 1992

Stereo test

Neil Walker
This utility provides a series of tests for use with the Music 5000 synthesiser to help in setting up an amplifier and speakers.
Load and RUN 'U.Testing' from the Main menu. Function key f4 is now defined as RUN. Select the 'Stereo Test' option from the menu. Each of the choices displayed is explained below.

PHASE check

This is the most difficult test: a check that the left and right speakers are in phase. That is, that when fed with the same signal the two speaker cones move in and out together. If any work has been done on the speakers - leads extended, plugs refitted, baffles made from doors, etc. - it is possible that the speakers are out of phase.
The different sound of an out-of-phase system can be very subtle: the stereo image position will be rather vaguely defined and the bass response tends to be poor, and the AMPLE 'INVERT' word may not give the required effect when your program is used on another system.
It is easily cured by reversing the connections to one of your speakers - it does not matter which one.
This test depends on sound cancellation and works best if the speakers are placed close together (around 12" apart) facing each other. It is possible to perform the check without moving the speakers, but this needs experience of the sounds produced on your particular system.
To try the test, select the PHASE option. This toggles, each time it is selected, between in-phase and out-of-phase signals to the speakers. The out-of-phase sound should be of an obviously lower amplitude and lacking bass, than the in-phase sound. Listen to the fundamental where the difference will be quite large. The higher harmonics are affected less.
If you hear the loudest bass on the out-of-phase sound reverse the connections to one of the speakers, at the speaker end or in the speaker plug. But remember to turn the amplifier off first - you are safe, but transistor amplifiers object to accidental touching together of speaker leads, and may go faulty in an expensive way. Before switching on again check there are no stray strands of wire left to short circuit the speaker leads.
If you have four or more speakers in use, deal with them in pairs and then match the pairs together.

Stereo Check

Each time this option is selected it cycles through right speaker on, left speaker on, and both speakers on.
With right or left speakers on the sound should only come from one speaker; if sound comes from both this is nothing to do with the speakers. Look at the amplifier input leads: somewhere the two inputs are joined together.

VOICES off

Silence - very popular with other people in the same room.

PAN check

This test is useful for placing the speakers relative to where you are sitting. On each selection it pans either the right voice to the left or the left voice to the right.

Sweep both

This test checks the overall frequency response of your system. It also helps to locate mechanical rattles or buzzing noises.
Keep the volume down on this test. Both speakers are fed with a very low (maximum negative SHIFT) to a very high (maximum positive SHIFT) frequency. High volume levels may damage your amplifiers and speakers. The speakers will flap around at very low frequencies and your amplifier may object to high levels of high frequencies. The SHIFT number tells you what is happening.
You will not hear anything at the extremities of the frequency spectrum; the point at which you start to hear or feel low frequency sound is mainly determined by your room and speakers. If you are youngish the speakers will be probably be the limiting factor with the higher frequencies; otherwise, as with me, it will be your ears.

Sweep Right

As above but right speaker only.

Sweep Left

As above but left speaker only.

Step up

As 'SWEEP both' but it steps the tone up in octaves.

Step down

As above but steps tone down in octaves.
These two tests give a quick check of response. Again, go easy on the volume.

Menu

Returns to first menu.
On the first menu I have left in the TEDIT choice used when writing the utility, though the running program does not use any of the AMPLE Toolbox extensions. This selection may be changed to something else.
The Finish option ('fin' word) will exit the program and return function key f4 to 'CLEAR' as standard.
Finally, if you are unsure about changing leads and connections - leave them alone. At least they work, which is better than nothing.

Related file on this disc:
U.Testing - Stereo test program

Published in AMPLINEX 024, January 1992

'Jukebox' revisited - EXEC file

% U.Jukeb62
% by Allan Gardner
% For more details see U.Jukeb/i
% Published by AMPLINEX November 1991
"getcat" [
zblk names cblk 1 #+ #!
62 cblk 5 #+ #! cblk 8 osgbpb
numfils numfil-a #!
numfil-a #? numfil-c #!
names ptr-a #! numfil-c #? FOR(
drvnum #? 48 #+ ptr-a c!
8 ptr-a #+!)FOR
]
"logo" [7 MODE curoff
0 0 tab 4 FOR(134x157x')FOR
2FOR(2 COUNT 1#-tab 129x141x)FOR
5 0 tab"Rcacccmmcb!c Jukcbau"$OUT
140x"(62 file DFS)"$OUT
5 1 tab"PFogFuMMudte Jokedox"$OUT
3 2 tab 132x
"(c) 1991 Allan M Gardner"$OUT
24 3 tab 132x"autoRepeat:"$OUT
repflg #? IF(35 3 tab 136x129x"ON"
$OUT)ELSE(35 3 tab 132x"OFF"$OUT)IF
srtflg #? IF(30 2 tab 129x" Sorted"
$OUT)ELSE(30 2 tab 132x"unSorted"
$OUT)IF28 24 tab 136x134x157x129x
"h"$OUT 132x137x"help"$OUT
]
"numfils" [
62 cblk 5 #+ #? #-
]
"printitle" [
dsktitl ptr-a #!
2 3 tab 132x"Disk:"$OUT
drvnum #? NOUT 129x
ptr-a c? FOR(
1 ptr-a #+! ptr-a c?
#11 126 #< IF(x)ELSE(#2 SP)IF
)FOR
]
"double"DELETE
"setdrv" [
% This word should be edited to suit
% the disc-drives used. Place '%'
% where required. (If all 3 options
% are removed with '%'s then the
% program will be correct for 1
% single-sided drive.

% drvnum #? 1 AND 1 XOR drive
           % for 2 single-sided drives

% drvnum #? 2 XOR drive
           % for 1 double-sided drive

  drvnum #? 2 #+ 4 #/ XOR drive
           % for 2 double-sided drives
]

Published in AMPLINEX 023, November 1991

'Jukebox' revisited

Allan Gardner
There have been a number of enquiries lately about my Jukebox program which was published in AMPLINEX 017. There have also been some kind comments for which I am grateful.
Firstly, I would like to answer the question about making the program suitable for ADFS. Whilst it would be perfectly feasible to modify the program, there are a number of problems associated with the change. The major one is that I have insufficient knowledge of the ADFS to perform the changes myself and I do not have access to an ADFS machine to develop the code in this direction. However if anyone has the know-how, inclination and machine to do the work I will be very willing to assist if he/she would care to contact me through AMPLINEX.
Next, an enquiry was made about changing the program to work with a 62-file DFS. This is a little simpler to implement. Although Matthew Grist (Question and Answers AMPLINEX 019) did not specify which particular DFS he was using, I have made the necessary modifications to work with Watford Electronics DFS (1.44) 62-file catalogues and have included the necessary modifications in the form of a file which should be EXECed into the Jukebox program as published in AMPLINEX 017.
The obvious change to the way in which the program is used is that only one side of a disc can be catalogued at one time, (a mode 7 screen would not be able to show 124 files in any sensible way). The 'd' key which selects the drive to be catalogued, now steps through the available 'sides' of drives in an order determined by the word 'setdrv'. This word should be edited (e.g. in Notepad) to suit the setup required. Commenting out any unwanted lines with '%' is probably the best way to change 'setdrv'.
Don't forget to save the modified program back to disc (the 'save' command is built into the program for this purpose).
Please let me know if it works the way you want it to.

Related file on this disc:
U.Jukeb62 - *EXEC file to be used with U.Jukebox file published in AMPLINEX 017

Published in AMPLINEX 023, November 1991

Yamaha TX81Z expander - voice editor

Ken Hughes
Before using the program make sure that the TX81Z is switched on and connect OUT3 on the Music 2000 to MIDI IN on the expander. Set the Basic Receive Channel to 1.
The reason I use OUT3 rather than OUT1 is because the memory address of MIDI IN on the Music 2000 is the same as OUT3, and I use both. If you wish to use OUT1 instead you will need to delete the reference to '3 MIDILINE' in the 's' and 'u' words.
The values in the program are the standard ones in the TX81Z initial voice data. Before using the program it is best to select the voice that you wish to edit and use the INIT VCE option. You then only need to alter the values that differ from the initial voice data.
The program consists of four parts, named 'one', 'two', 'three' and 'name'.
To use it, call up Notepad and GET 'one'. You may then change the values in text mode or change to panel mode (f2) and use the Shift, plus the arrow and pound sign, keys. Pressing f1 (play) at any point will send all the values to the TX81Z.
The same procedure applies to parts 'two' and 'three'.
To send the name of the altered instrument, GET 'name', alter the name in text mode, and MAKE it. Enter command mode and type
name <Return>
to send it to the expander.
If you wish to keep the new instrument on disc for re-loading into the TX81Z, then MAKE all four parts after editing them and save the program to disc with a name of your choice. The data can then be re-loaded and sent to the expander using the words 'one', 'two', 'three' and 'name' in command mode. The TX81Z will not take the data from all four parts in one go.
Please note that the program does not use some of the infrequently used data values. If you require these you can make up another panel to send them or enter them directly on the front panel of the expander. I have given the range of the data values on the panels. There is no data error check in the program, but the TX81Z appears to ignore wrong data.

How the program works

To change the LFO speed on the TX81Z requires the following system exclusive message to be sent:
&F0  - Start exclusive message
&43  - I.D. (Yamaha)
&10  - Basic Receive Channel (1)
&12  - Group Number
54   - Parameter
0-99 - Data
&F7  - End of exclusive message
The first four bytes are in the 's' word. The last byte is in the 't' word. The parameter is in the 'LFO Speed' word which also calls the 's' word. The data byte is the number on the screen. The '|' word calls the 't' word.
Thus the line 'LFO Speed 35 |' sends:
1     VOICES MIDIV
3     MIDILINE
&43F0 MIDIWOUT
&1210 MIDIWOUT
54    MIDIOUT
35    MIDIOUT
&F7   MIDIOUT
Some items such as the Algorithm need a data number 1 less than the required value to be sent out - thus Algorithm 1 needs 0 to be sent. This is done by using the word ':' or '-|' instead of '|'. 'name' uses the '_' word to convert the letters typed in to their ASCII numbers.
This program works in a similar way to Ian's Waugh's TX81Z performance editor program (published in Micro User, August 1990) except that it will only send a complete Notepad page. As it is a voice editor program it could be put with Ian's performance editor to make a complete editor program for the TX81Z. The programming methods in these programs could also be used by owners of other types of expander to control their own equipment by making up their own panels.

Related file on this disc:
U.TX81Zve - Voice editor for the Yamaha TX81Z expander. Note: this program can be loaded only if you are using a Music 2000 system disc.

Published in AMPLINEX 022, July 1991

AMPLE modules in Sideways RAM

Martijn van der Mei
This utility enables you to put Hybrid Music System modules (M.PAD, M.MIX, M.STAFF etc.) into Sideways RAM. This is not a copy of the Hybrid Technology Sidemod program (included in their AMPLE Toolbox disc), though it was created (in April 1989) for a similar purpose: that is, to speed up access to utility modules and to eliminate the need to have the system disc present after booting up the system.
The program (U.AMSR) creates a ROM image, containing the modules you select. As a ROM cannot contain more than 16K of data, it is impossible to squeeze all the modules into one, so when you run the program you'll be asked to type a identity number (1-3), which has the consequence of using another free vector. This means that you can use up to three ROMs at a time for module storage without the problem of ROMs intercepting each other, which causes the filing system to disappear and probably crashes the machine. This gives a potential of 48K excluding the ROM control software.
When you run the program you will be asked to insert your system disc. This should be placed into the currently selected drive (probably the one you loaded the program from). The program will then search the disc for modules and present a menu of those available. The menu couldn't be simpler. Just select the letters of the modules you want and watch the free space counter decrease until nothing more can be installed (beep!). You can de-select a module by pressing its letter again. After pressing Return, the modules are loaded and the ROM software assembled. You can then save the ROM image to disc.
When ROMs are loaded into Sideways RAM they do not become active until a Control+Break has been done. This means that the ROM images should be loaded before the AMPLE system is started.
You can create three different ROMs in this way. Be careful when you re-load these ROMs, because you're guaranteed that your filing system will NOT work if you have two or more ROMs with the same identity number, due to there being interceptions on the same vector.
The module prefix must be set to 'M.' in your !BOOT file (i.e. "M."MPREFIX) for the ROM files to be found. If you have a dual-drive system you may have set it to a specific drive (e.g. ":0.M."MPREFIX) and the system will still try to load from disc.

Editor's note:
Some minor problems have been found with this utility: in particular it seems to affect the selection of the disc filing system on Break and Shift+Break. Because these are not major problems, and because another member may be able to find the solution we have decided to publish the utility in its present form.

Related file on this disc:
U.AMSR - BASIC program to allow AMPLE modules to be placed in Sideways RAM. Type CHAIN "U.AMSR" to run.

Published in AMPLINEX 021, March 1991

MIDI IN via the Music 2000

R J Bettis
Some time ago (AMPLINEX issues 006 and 007) a couple of articles by Scott Mackie described the construction and use of a MIDI interface for the BBC running AMPLE.
This article describes a modified version of that interface, which I have adapted to work with the Music 2000. It also works with my master keyboard (a Cheetah) which uses the MIDI 'running status' system in its data output.

1) History

Shortly after the interface articles appeared I acquired a Music 2000 interface, and since then my MIDI system has grown, while the Music 500(0) has lost out as a sound source. This is mainly because of the increased expression available from a touch-sensitive keyboard (and the sound quality of relatively cheap MIDI units).
Some of the Music 5000 facilities, such as a wide range of readily programmable sounds have been tempting me back every now and then, and eventually I decided to try and incorporate the Music 5000 as a MIDI expander (as opposed to using the Music 2000 as its controller).
I remembered Scott's articles, dug out the discs, and examined the software. There were three programs, a main AMPLE control program, a machine code program to run the interface, and a BASIC source program for the machine code.
I then made the modifications needed to run the program with my system - these were almost all in the machine code.

2) Technical details

The original hardware and software used the (rather drastic) NMI interrupt, whereas the Music 2000 uses the normal interrupt system. Hence the program had to be altered to (a) use this interrupt, (b) set itself up in the interrupt chain and (c) avoid acting upon or corrupting other interrupts using the same system.
The result was that I replaced the whole of the original interrupt handler with a new section of code. This then made the program too long for its original location (page &900) so I had to expand downwards to start at &8D0. This area is used by the operation system for sound envelopes 2-4, so seemed fair game in an AMPLE environment.
The second problem I discovered was that my keyboard uses 'running status'. A typical MIDI message consists of a command byte followed by (usually two) data bytes; however, the specification allows for just the two data bytes to be sent if the command hasn't changed.
For example, a 'note on' message might be three bytes:
<note on> <note number> <velocity>
but with running status a three note chord could be sent as:
<note on> <note 1> <velocity 1>
          <note 2) <velocity 2>
          <note 3> <velocity 3>
saving a couple of bytes in transmission.
This means that the receiver now has to keep a note of the last command so that this can be employed.
The BASIC program for the new code is in file U.MXbasic, and the code this produces is called U.MXcode.

3) In AMPLE

The AMPLE program ('U.MXample') is largely the same as Scott Mackie's original (on the principle of 'if it works, don't mess with it'). It has a quite comprehensive 'help' facility written into it.
Calls to the code have been altered to reflect the new locations, and two new commands have been added:
'go'  gives a list of all available instruments and ask for a choice
      to be made before using MIDI
'ins' sets up to use an instrument 'inst', so that new sounds can be
      tried easily (alter 'inst', MAKE and run 'ins')

Related files on this disc:
U.MXbasic - Basic program to produce U.MXcode
U.MXample - AMPLE program to enable use of Music 5000 as MIDI expander

Published in AMPLINEX 019, September 1990

Crumple: TMS to AMPLE converter

A J P McMaster
Crumple (ConveRsion Utility for aMPLE) takes a music file created by Island Logic's 'The Music System' (TMS) software and produces from it a text file which contains AMPLE words corresponding to the actual music (part1a etc.) plus a 'RUN' word and basic 'info' and 'mix' words. This text file can then be *EXECed into AMPLE and played through the Music 5000 synthesiser.
Use of the Crumple program is simple: all that the user need do is enter names for the TMS file, the AMPLE text output file, the name of the tune and the name of the author (tune and author are optional). Once this is done the program will do the conversion and finish.
For simple TMS files it should be possible to *EXEC the output file straight into AMPLE - but for more complex music files things may be a little more complicated.
Converting files from TMS to AMPLE is not quite as trivial as it might seem. A certain amount of manual 'post-processing' may need to be done to the resulting file but this is fairly easy since the file can be loaded into a word processor for adjustment.
One advantage of using a word processor is that it avoids the inadequacies of the Notepad editor in dealing with long lines or many of them. Restrictions within Crumple try to avoid these, but long bars could still overrun.
Another problem area is repeated sections. The best solution is to repeat the part(s) in the RUN word and I felt this could be better done manually (consider the problem of 1st and 2nd time bars, for example). I have thus taken an easy way out - when confronted with any kind of repeat symbol, Crumple introduces a comment describing the symbol and starts a new word. This should ensure that no repeats occur mid-word.
Crumple sets up the key signature and time signature but the tempo gives problems and so it is included as a comment only. The tempo is worked out by a function that, in theory, should give a correct value, but which in practice rarely works sensibly.
Crumple sets up a standard 'mix' word with the first three voices in the TMS piece being given an Upright instrument, and the fourth voice being given a Drum instrument. These can then be altered within AMPLE.
The 'info' word contains the title of the tune and name of the author if these were entered.
Members who wish to adapt or improve the program are welcome to do so, and shouldn't find it too difficult to change the program to suit themselves as it is extensively commented.
In spite of the failings outlined above the program does carry out the major work of converting the notes themselves.

Related file on this disc:
U.Crumple - TMS to AMPLE conversion utility (written in BASIC)

Published in AMPLINEX 018, July 1990

Programmable Jukebox – version 2

Allan Gardner
These notes describe the new version of my Programmable Jukebox - the original version was published by A&B Computing magazine in November 1988. The program has been rewritten and improved for use by AMPLINEX members.
The main improvements over the original version are:
a) The menu layout has been much improved and tidied up, presenting a less 'cluttered' screen
b) The highlight cursor now has full wrap-around in all four directions, making getting to the file you want much easier and quicker
c) Ten pages of on-line help are available at the press of a key
d) The program can now present a menu from both sides of a double-sided disc
e) There's the option of generating a 'playing sequence' of files from all four surfaces of a double-sided dual-drive disc system
f) If desired the entire sequence can be set to auto-repeat indefinitely
g) This Jukebox can sort the filenames into 'ASCII-betical' order, helping you to find that elusive file.
These improvements have resulted in a complete re-coding of the program.
All the features of the original program, including automatic updating of the menu, programming of sequences of up to 63 files and self-generation of 'CHAIN' words, have been retained.
However some of the keys and commands have been changed from the original, as has the coding of the sequence buffer.
The keys and commands now used are:
CURSOR   highlight filename
 KEYS    (no change)
<COPY>   enter file into sequence
         (no change)
<RET>    play file or start sequence
         (no change)
<DEL>    wipe sequence/re-catalogue
         (previously <r>)
<d>      swap drive on dual-drive system
         (new command)
<r>      enable/disable autoRepeat
         (<r>-previously restart)
<s>      sort filenames in ASCII sequence
         (new command)
<ESC>    stop program or enter command mode
         (no change)
CHAIN    generate CHAIN words on disc
         (previously chaingen)
save     saves 'Jukebox' to disc
         (no change)
"double" [ON]
         to use double-sided discs
         (new word)
"double" [OFF]
         to use single-sided discs
         (as above)
<f9>     "Jukebox" LOAD RUN
         (no change)
<f4>     "Jukebox" LOAD run
         (no change: but note that a
         'bug' in the original version
         existed where a 'sequence' of
         one file meant that function
         key four was programmed to
         contain "Jukebox" LOAD run
         (instead of CLEAR). This is
         now corrected).
The writing of the sequence buffer has been altered to include the autoRepeat feature and to add disc drive-numbers to the filenames.
This does mean that a sequence buffer written with Jukebox version 1 is unreadable by version 2 but this will not cause any problems, as the buffer is cleared by both versions before the programming of sequences is begun.
Note that the program is supplied to suit single-sided drives to avoid generating an error when trying to read the 'second' side of a single-sided system.
The word 'double' should be edited to suit your disc-drive(s).
P.S. if anyone can come up with a quicker sort routine - I'd be very interested.

Published in AMPLINEX 017, May 1990

AMPLINEX Staff Printer

Bob Ord
Since I am not a keyboard player but a guitarist, and having been told by Hybrid Technology that the only way to print out AMPLE on a stave was to use the Music 4000 keyboard, I decided to write this program for those who do not have a Music 4000 keyboard but who would like to print out their music in staff notation. Shadow RAM is required.

Shadow RAM

The program is written in BASIC, uses a mode 0 screen and may have to load a large AMPLE program. Use is therefore made of Shadow RAM. The Shadow RAM call is set for the BBC Master and B+ and occurs at the beginning of the U.ASP file. Users of other types of Shadow RAM will have to alter this to suit their needs.

Suitable printers

The AMPLINEX Staff Printer consists of two BASIC programs with a fast machine code printer driver for Epson compatible printers with the 640 dot-addressable bit image mode.

The screen

ASP's screen consists of three windows: one in the top left corner used for various control functions, one in the top right corner for information and one across the bottom half of the screen which displays the stave.
Initially the program asks for an AMPLE filename, directory and drive number: the latter two have defaults of $ and 0 if the Return key alone is pressed.
Pressing the Return key alone when the filename is requested will display a catalogue of the selected drive in the information window.

Loading an AMPLE file

Once an AMPLE file has been entered and loaded, the AMPLE words in the file created using the Staff editor (i.e. having the comment %STAFF) are displayed in the information window.

Single or multiple word option

Single or multiple words may be printed. The program asks for the number of words if the multiple option is chosen. These are printed out in the order that the names of the words are entered.

Screen or printer option

Either screen only, or screen and printer, output may be produced. The screen output is useful for checking that you have the correct word name before committing anything to paper.

Escape key

Pressing the Escape key at any time will reset the program to the initial state waiting for an AMPLE file name.
Pressing the Control and Escape keys together will exit from the program.

Errors

All operational errors are reported in the information window.

Related files on this disc:
U.ASP - AMPLINEX Staff Printer main program
U.ASP2 - AMPLINEX Staff Printer secondary program
U.ASPcode - AMPLINEX Staff Printer machine code printer driver

Published in AMPLINEX 016, March 1990

Drums on the Music 4000 keyboard

David Westbrook
This is a little program I've found useful for trying out drum parts. It was inspired by Richard Bettis's keyboard split program (AMPLINEX 007) and needs a Music 4000 keyboard.
My program uses Richard's technique (in the word 'splitact') to allocate 8 drum sounds to different parts of the Music 4000 keyboard, thus giving you an easily accessible 'drum kit' to play with. When you've found a nice drum pattern you can then record the parts separately as usual - provided you can remember them!
When the program 'U.DrumKey' is loaded and run, it splits the keyboard into 8 groups of notes, each group producing a different instrument. The title display gives you a rough idea of where each instrument is. In all cases except the toms, the sound is of a constant pitch, so it doesn't matter which key in the group you hit. The toms are tuned, so each key in this group does produce a different pitch.
As Richard explained, the more groups the keyboard is split into, the slower the response. My eight-fold split is really pushing it a bit, so if you hit more than one drum simultaneously you'll notice a distinct lag. However, I don't find this too disturbing and I think it's worth it for the range of sounds. If you disagree, it's fairly easily changed to have less voices: look at 'splitact' and 'setkit'. Have fun!
Related file on this disc:
U.DrumKey - Music 4000 drum kit utility

Published in AMPLINEX 015, January 1990

Fast Fourier analyser

Bob Ord
I wrote this BASIC program about five years ago for use with AMPLE BCE. It may be of interest to those who use the waveform editing utility published in AMPLINEX 014.
The program allows you to draw the desired waveform and then takes it and performs a Fourier analysis upon it. Once the analysis is complete the screen clears and displays the amplitude and the phase angle of the first 16 harmonics of the drawn waveform.
When drawing the waveform use the whole grid to draw one complete cycle of your waveform.
The phase angle is not much use for the Music 5000 software but the amplitude value is, and should be taken as a percentage. It is easier to define a waveform using the WH! instruction than to define the 128 points needed to use the WG! instruction.
Full instructions for the keys used are given in the program.
Related file on this disc:
U.FFA - Fast Fourier analysis. BASIC program

Published in AMPLINEX 015, January 1990

Music 500 Waveforms

Courtesy of and copyright Hybrid Technology
For use with U.Wave program.
% Waveform definitions:
"bright" [WZERO 181 1 WH! 155 2 WH!
181 3 WH! 62 4 WH! 76 5 WH! 37 6 WH!
14 7 WH! 3 8 WH! WHG WGC]
"medium" [WZERO 4FOR(159 INDEX WH!)FOR
WHG WGC]
"dull" [WZERO 243 1 WH! 74 2 WH!
27 3 WH! 19 4 WH! 16 5 WH! 12 6 WH!
8 7 WH! 8 8 WH! 4 9 WH! 4 10 WH!
WHG WGC]
"reed" [WZERO 242 1 WH! 220 3 WH!
200 5 WH! 180 7 WH! 120 9 WH!
80 11 WH! WHG WGC]
"wierd" [WZERO 234 1 WH! 167 8 WH!
134 12 WH! WHG WGC]
"delta" [WZERO
16 FOR(172 INDEX WH!)FOR WHG WGC]
"tri" [32 FOR(INDEX 1 #- #11 #+ #11 #+
#11 INDEX WG! #11 65 INDEX #- WG!
0 #12 #- #11 64 INDEX #+ WG! 129
INDEX #- WG!)FOR WGC]
"qsine" [WZERO 128 4 WH! WHG
96 FOR(0 INDEX 32 #+ WG!)FOR WGC]
"pulse" [32 FOR(127 INDEX WG!)FOR
96 FOR(-127 INDEX 32 #+ WG!)FOR WGC]
"ramp" [128 FOR(INDEX #11 #+ 129 #-
INDEX WG!)FOR WGC]
"rand1" [0 RAND!
128 FOR(RAND INDEX WG!)FOR WGC]
"rand2" [255 RAND!
128 FOR(RAND INDEX WG!)FOR WGC]
"null" [WZERO WGC]
% Setup words:
"W!" ["Wave "$OUT#11NOUTNL WMOD]
"preset1" [1 W! bright 2 W! medium
3 W! dull 4 W! reed 5 W! wierd
6 W! delta 7 W! tri8 W! qsine
9 W! pulse 10 W! ramp 11 W! rand1
12 W! rand2 13 W! null NL]
% Type preset1 to set up all
% 13 waveforms

Published in AMPLINEX 014, November 1989

Music 5000 waveform editing utility

Richard Bettis
The Music 5000 environment provides 14 standard waveforms - Bright, Broad, Clear, and so on. These are defined during the start-up of the system. Unlike its predecessor (the Music 500) there is no facility to alter these waveforms, or to change their names.
In some ways this is an advantage - using the Music 5000 approach is certainly much simpler, and the pre-defined waveforms cover many of the sound types that one might want to produce.
In some circumstances, however, it would be nice to have some wave definition abilities. For example, I really like a good strong square wave sound, which 'Hollow' just doesn't quite produce.
In AMPLINEX 009, Ian Guinan described the relationship between the Music 500 and 5000 waveforms, and demonstrated a method for using the Music 500 waveforms on the Music 5000. The big disadvantage of this method is that you need to run the Music 500 software to set up the waves. (I hardly remember how to do it, and others won't have a copy).
I have therefore written the U.Wave program, which allows any (or all) of the Music 5000 waveforms to be redefined.

Using U.Wave

1) The main screen
When U.Wave is RUN it gives a mode 4 screen divided into three windows.
At the top is a graph in which a waveform can be displayed. Below that, to the right, is a chart of harmonic levels for a waveform. These are similar to the charts on pages 127-129 of the Music 5000 User Guide.
The third window is for AMPLE, and serves to confine user activity to one area of the screen. It is in this window that you control the actions of U.Wave.
2) Seeing it work
There are 4 waveforms built into the program. In each case they replace the 'Hollow' waveform with the new one. An instrument definition (imaginatively called 'ins') puts the wave to work.
The 4 waveforms are: Square, Saw, Pulse and Hwave. Entering the wave name causes the whole redefinition process to be carried out.
3) Doing it yourself
A waveform definition consists of 128 points which describe one cycle of the wave. Each point can have a value between -127 and 127.
For example, the Square wave has points 1 to 64 all at 127, and points 65 to 128 all at -127.
As an alternative, a wave can be described using the relative strengths of the first sixteen harmonics. Each harmonic strength can be at any value from 0 to 255.
For example, a pure sine wave would have a first harmonic of strength 255, and all the others at 0.
The waveform defining words are compatible with those on the Music 500 and are all defined in upper case. This means that Music 500 wave definitions can be imported although some preparation may be needed to cope with other AMPLE BCE to Nucleus discrepancies (such as RAND? versus RAND).
4) Wave definition vocabulary
The syntax of each word is shown below using lower case letters to indicate numerical values. There is also a short description of its use.
WZERO      initialises the wave and harmonic buffers,
           setting all values to 0
x WMOD     specifies which wave is to be changed (see table 1)
           x = 0 to 13
vv nn WG!  sets the value of wave point nn to vv
           nn = 1 to 128
           vv = -127 to 127
nn WG?     puts the value of wave point nn on to the stack
           nn = 1 to 128
           (e.g. 100 WG? NOUT will print the value of point 100)
WGC        moves the waveform from the computer to the synthesiser unit
           Once this is done the new waveform can be used
ss hh WH!  sets the strength of harmonic hh to spreadsheet
           hh = 1 to 16
           ss = 0 to 255
WHG        This makes a waveform from the harmonics specified by WH!
           This must be done prior to a WGC command to put the waveform
           into the synthesiser unit.
5) Other U.Wave commands
There are some other commands in the U.Wave program which are for interactive use.
wdraw      displays the current waveform
           Any waveform created by a user word or by direct entry of
           wave change commands in the AMPLE window can be seen using
           this method.
edit       loads the Notepad editor so that the predefined waveforms
           may be examined and altered. (In mode 4 on a standard BBC
           Model B there is so little room left that many extra
           waveforms are impossible)
graph      gets back to the mode 4 graphics screen,
           QUITting and MDELETEing the editor.
dump       spools all the words needed for wave manipulation out to a
           file called E.WaveUse. This can then be *EXECed into other
           programs. None of the functionality is lost, but the
           graphical displays are!
           (When *EXECed into another program the wave change system
           needs nearly 2500 bytes, 1800+ for words and the rest for
           its run time arrays).
6) To get started...
First of all, RUN the program and check that the Pulse waveform has been selected. (Type in a few note letters, or use a Music 4000 keyboard if you have one).
The screen should show the Pulse waveform plotted in the top left of the screen, and indicate that the current waveform is a Geometric one in the Harmonics window. (This just means that the current wave hasn't been defined using harmonics).
Now enter 'Saw' at the % prompt.
The waveform should be redrawn, and playing a few notes should confirm that a change has been made in the synthesiser waveform (the tone will have changed markedly, into one that is much richer in high frequencies).
Try the other two waveforms too. If you type 'help' at the % prompt a list of the supplied waveforms is displayed. When you try Hwave you will notice that a message is given as the three harmonics are processed.
To illustrate the use of harmonics use WZERO to initialise the current waveform and then enter
127 1 WH!
 80 2 WH!
 40 4 WH!
 20 6 WH!
WHG
WGC
wdraw
As each harmonic is processed a message is given. (This just proves that the machine is working, as it does take a little time to do the processing!) The new waveform will they be shown and can be played.
You can use 'edit' to get to Notepad and alter any of the defined waveform words. (See notes below before starting!)
You will see that Square and Pulse use similar techniques, while Saw has a little more maths to it. Hwave uses harmonic waveform creation.
Apart from the obvious range of facilities for experimenting with waveforms that is provided, you can also create harmonic waveforms then, following a WHG command, each value can be extracted using WG? for further changes.
To produce a range of more complex waveforms you may need to 'dump' the wave change words into your own program, to give extra working space.

Notes

As the program stands, it uses quite a lot of the available memory at run-time.
If you wish to create any new words, you must first create some space by deleting existing ones. (The prime candidates must be the 'dump facility' words 'dump', 'dump2' and 'dump3').
Note that, because of the way AMPLE works, you can create new words when using Notepad, or even at the mode 4 prompt under some circumstances, but get a '!No room' error when the program is RUN. You have been warned!
I should like to acknowledge the contribution of Mike Mellors, who both tested my program for the problem found in the Soundsculptures software (see AMPLINEX 012), and provided the solution in the form of the 'trans' word.

Related files on this disc:
U.Wave - Richard Bettis' waveform design and editing program
U.Preset1 - EXEC file of Music 500 waveform definitions courtesy of Hybrid Technology

Published in AMPLINEX 014, November 1989

AMPLINEX Spectral Harmonic Analyser

Bob Ord
Whilst creating a 2 CHAN instrument word I found that I was trying all the permutations and combinations of the waveforms provided with the Music 5000 system. Also, I found that once I had the two waves I wanted, varying the amplitude of the waves (via AMP) affected the instrument's timbre.
I needed help.
I therefore, placed eight instruments defined thus
2 CHANS
EVERY CHAN
 Pure     Flat     Onoff
 128 AMP
into the Mixing Desk and sent each voice a note from the harmonic series. By varying the faders I could thereby vary the amount of a given harmonic the resulting sound contained. Having verified that this technique would work I set about writing the AMPLINEX Spectral Harmonic Analyser - ASHA.
The program allows the user to set the amplitude of the first eight harmonics of a sound and playback the result. When the desired result is obtained the program analyses the harmonics used and tries to find the two Music 5000 waveforms and their amplitudes that produce the same timbre.
Once these are found the program displays the result in the following form:
"newins" [
2 CHANS
 1 CHAN
  wave#1    Flat     Onoff
  amplitude#1 AMP
 2 CHAN
  wave#2    Flat     Onoff
  amplitude#2 AMP
EVERY CHAN
]
This word, once copied, can be brought into Notepad and, after the command
1 VOICES
is entered and f1 pressed within Notepad, checked to ensure that the timbre is correct.
Only seven keys are used by the program, they are:-

Cursor right and left

Move the blue box cursor right and left and thus select the desired harmonic.

Cursor up and down

Set the amplitude of the selected harmonic.

Delete

Resets the selected harmonic to zero.

Return

Plays the sound shown on the screen.

Copy

Starts the analysis of the spectrum shown on the screen. This may take quite a few minutes depending upon the sound spectrum entered.

Related file on this disc:
U.ASHA - AMPLINEX Spectral Harmonic Analyser

Published in AMPLINEX 013, September 1989