Sinclair ZX Spectrum
1 is the shortest note and 9 the longest. They are related to musical convention according to the following table.

NumberNote NameMusical symbol
1semi quaver
2dotted semi-quaver
4dotted quaver
6dotted crotchet
8dotted minim

Each of these controls the length of all notes which follow it until you give a new number code.

You can also use the numbers from 10 to 12 to specify triplet notes (three notes played in the time normally used for two).

NumberNote NameMusical symbol
10triplet semi-quaver
11triplet quaver
12triplet crotchet

Each of these only applies to the three notes following it and must be followed by their three names, e.g.

10 LET a$="11ACE"

A rest (no note playing) is specified by a & and has the same length as the current note. For example

10 LET a$="7A&B&C&D&E"

is five minims with equal pauses between them.

Tied notes can be indicated by giving the two note durations connected by an underscore character and the note name, e.g.

10 LET a$="3_5A"

The second note duration you give will also apply to any following codes until you give another duration code.

The N Command
In some of the examples you will see the letter N used to introduce a series of notes within the string, e.g.
LET a$="O7N1CDE"
N is used in cases where two sets of numbers would otherwise clash. In the example above, O is set to octave 7, then a series of notes is given, starting with the duration code 1. Without the N code, the Spectrum 128 would read the octave code as 71 - obviously not what was intended!

Note volume

The overall volume of the sound is controlled by the volume setting of your TV or amplifier. You can control the volume of individual notes and phrases within the tune by using the V command. V followed by a number from 0 to 15 sets the following note(s) to a constant volume. The lower the number, the quieter the sound, with V0 completely silent (V0 is a useful way of stopping one channel playing while others continue). V15 is the maximum and is used automatically by the Spectrum 128 if you do not specify a level.

The low volumes are very quiet and you will normally use 10 to 15 unless you are outputting to an amplification system or via the MIDI port to a synthesizer. Try running this program

10 LET a$="V10cdefgabCDEFGAB"
20 PLAY a$

Now try changing the number after the V to a new value to hear the difference

Volume effects

Instead of you just setting each note to a fixed volume, PLAY also lets you change the volume of the sound while it is playing. For example, you can make a note start suddenly and then die away (like a piano) or make a sound effect rise and fall in volume (like a steam train).

This effect is controlled by the letter W which can be included in any of the strings controlled by the PLAY command. You must also include the letter U in each string where you want to use the effect. You cannot use it if the string already has a volume setting (if it contains a V) - the volume command will overrule the effect.

Sinclair ZX Spectrum

  Previous Page Back Next Page