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