Home -> Magazines -> Issues -> Articles in this issue -> View
Micromusic | |
BASIC music loading program for the ZX81Article from Electronics & Music Maker, March 1982 | |

When the program is first run, it will start off by asking you the number of voices (synthesisers) you want to use, the number of notes, and the name of the piece. The number of notes is not necessarily the same as the number of "blobs" in the music; this variable should more accurately be called "events". For instance, if a quaver is the shortest note in the piece, and the music is in 4/4 time, there will be 8 quavers per bar. For reasons which will be explained, you would probably want 16 events per bar, and a 100 bar piece would require 1600 events. You will need a 16K RAM pack to fit the program in, and with this amount of memory there is room for over 12800 events; using the maximum of seven voices, this allows 1825 events per voice, which should be sufficient for most uses.
Once the initial conditions are established, the program moves on to the "title page" which repeats the information you've just fed in, and also presents a list of choices of what to do next; this also happens when the program is loaded from tape.
The choices are selected by entering the appropriate letter. P, T and S should be self explanatory; C enables you to start again from scratch, and E (or indeed any character other than P, T, C or S) is for writing or altering the music. The letter E by itself will start at event 1; if you want to start halfway through, enter E250 (for instance) to start at event 250.
Once you are in edit mode, these letters still have the same effect, so you can skip about by entering E followed by a number for example; and there is also a further "menu" to aid the music entry. If the entry is a number (detected by lines 2115 to 2135) this is taken as a note to be entered; the note code system will vary according to the synthesiser in use, and this was covered in January.
V followed by a number allows you to choose which voice to enter; e g. V2 selects voice 2. A letter V at the top of the display points to the voice in use.
New line allows you to skip on to the next event without entering any data.
R enters a rest.
J repeats the previous entry.
K repeats the previous event, but on all voices at once; for sustaining a chord, for instance.
B repeats a whole block of several events. This is also useful for moving the data around — so that you can insert new material, for instance.
F (for fine) signals the end of the piece.
D (for da capo) also signifies the end, but makes the piece repeat until BREAK is pressed.

Figure 1 is an extract from a piece by yours truly, written so that it uses the maximum of seven voices. The shortest note is a quaver, so you might expect the extract to need 8 events per bar, 16 altogether. In fact, in some places notes are repeated, but not "tied"; a musician playing these would automatically insert a small rest between them, even though one is not written. The computer has to be told about these rests explicitly, and so we allow 32 events to give room for the rests.
Table 2 shows how the piece would appear programmed in "linear" code — for feeding D to A converters for instance — and Table 3 gives the same thing in Wasp code; hopefully these examples will clarify any minor points I haven't explained.
As you will see, a certain amount of effort (not to say tedium) is involved in entering a lengthy piece of music; this is the price you pay for such a good value system. How much would a 12 000 note sequencer cost from a commercial manufacturer, if such a machine were available? For the sake of a day's work slaving over a hot TV set, my ZX81 can play nearly any music I choose, as many times as I like, and much better than I ever could! (My chess computer keeps beating me too.)

| 1 | 30 | 37 | 32 | 28 | 22 | 18 | 6 |
| 2 | 30 | 37 | 32 | 28 | 22 | 18 | 6 |
| 3 | 30 | 37 | 32 | 28 | 22 | 18 | 6 |
| 4 | R | 37 | 32 | 28 | 22 | 18 | 6 |
| 5 | 37 | 37 | 32 | 28 | 22 | 18 | 6 |
| 6 | R | 37 | 32 | 28 | 22 | 18 | 6 |
| 7 | 32 | 37 | 32 | 28 | 22 | 18 | 6 |
| 8 | R | R | R | R | R | R | R |
| 9 | 32 | 37 | 32 | 27 | 23 | 18 | 13 |
| 10 | R | 37 | 32 | 27 | 23 | 18 | 13 |
| 11 | 35 | 37 | 32 | 27 | 23 | 18 | 13 |
| 12 | R | 37 | 32 | 27 | 23 | 18 | 13 |
| 13 | 32 | 37 | 32 | 27 | 23 | 18 | 13 |
| 14 | R | R | R | R | R | R | 13 |
| 15 | 27 | 37 | 32 | 27 | 23 | 18 | 13 |
| 16 | R | R | R | R | R | R | R |
| 17 | 28 | 42 | 37 | 33 | 28 | 21 | 6 |
| 18 | 28 | 42 | 37 | 33 | 28 | 21 | 6 |
| 19 | 28 | 42 | 37 | 33 | 28 | 21 | 6 |
| 20 | R | 42 | 37 | 33 | 28 | 21 | 6 |
| 21 | 35 | 42 | 37 | 33 | 28 | 21 | 6 |
| 22 | R | 42 | 37 | 33 | 28 | 21 | 6 |
| 23 | 32 | 42 | 37 | 33 | 28 | 21 | 6 |
| 24 | R | R | R | R | R | R | R |
| 25 | 30 | 42 | 37 | 33 | 28 | 21 | 9 |
| 26 | R | 42 | 37 | 33 | 28 | 21 | 9 |
| 27 | 33 | 42 | 37 | 33 | 28 | 21 | 9 |
| 28 | 33 | 42 | 37 | 33 | 28 | 21 | 9 |
| 29 | 33 | 42 | 37 | 33 | 28 | 21 | 9 |
| 30 | R | 42 | 37 | 33 | 28 | 21 | 9 |
| 31 | 32 | 42 | 37 | 33 | 28 | 21 | 9 |
| 32 | R | R | R | R | R | R | R |
| 33 | STOP |
Table 2. Figure 1 music in "linear" code.
| 1 | 23 | 16 | 21 | 25 | 35 | 39 | 39 |
| 2 | 23 | 16 | 21 | 25 | 35 | 39 | 39 |
| 3 | 23 | 16 | 21 | 25 | 35 | 39 | 39 |
| 4 | R | 16 | 21 | 25 | 35 | 39 | 39 |
| 5 | 16 | 16 | 21 | 25 | 35 | 39 | 39 |
| 6 | R | 16 | 21 | 25 | 35 | 39 | 39 |
| 7 | 21 | 16 | 21 | 25 | 35 | 39 | 39 |
| 8 | R | R | R | R | R | R | R |
| 9 | 21 | 16 | 21 | 26 | 34 | 39 | 32 |
| 10 | R | 16 | 21 | 26 | 34 | 39 | 32 |
| 11 | 18 | 16 | 21 | 26 | 34 | 39 | 32 |
| 12 | R | 16 | 21 | 26 | 34 | 39 | 32 |
| 13 | 21 | 16 | 21 | 26 | 34 | 39 | 32 |
| 14 | R | R | R | R | R | R | 32 |
| 15 | 26 | 16 | 21 | 26 | 34 | 39 | 32 |
| 16 | R | R | R | R | R | R | R |
| 17 | 25 | 7 | 16 | 20 | 25 | 36 | 39 |
| 18 | 25 | 7 | 16 | 20 | 25 | 36 | 39 |
| 19 | 25 | 7 | 16 | 20 | 25 | 36 | 39 |
| 20 | R | 7 | 16 | 20 | 25 | 36 | 39 |
| 21 | 18 | 7 | 16 | 20 | 25 | 36 | 39 |
| 22 | R | 7 | 16 | 20 | 25 | 36 | 39 |
| 23 | 21 | 7 | 16 | 20 | 25 | 36 | 39 |
| 24 | R | R | R | R | R | R | R |
| 25 | 23 | 7 | 16 | 20 | 25 | 36 | 36 |
| 26 | R | 7 | 16 | 20 | 25 | 36 | 36 |
| 27 | 20 | 7 | 16 | 20 | 25 | 36 | 36 |
| 28 | 20 | 7 | 16 | 20 | 25 | 36 | 36 |
| 29 | 20 | 7 | 16 | 20 | 25 | 36 | 36 |
| 30 | R | 7 | 16 | 20 | 25 | 36 | 36 |
| 31 | 21 | 7 | 16 | 20 | 25 | 36 | 36 |
| 32 | R | R | R | R | R | R | R |
| 33 | STOP |
Table 3. Figure 1 Music in Wasp code. Note that the bass Wasp will need to be set an octave lower than the others to get in range.
When is a Computer? (Part 1) |
Mac Notes |
The Musical Micro - Software For The 64 |
Software Support - Hints, Tips & News From The World Of Music Software |
Apple Notes |
PC Notes |
Software Support - Hints, Tips & News From The World Of Music Software |
ST Notes |
Digital Signal Processing - An introduction (Part 1) |
Software Support - Hints, Tips & News From The World Of Music Software |
The Musical Micro - Of Mice And Micros |
Software Support - Hints, Tips & News From The World Of Music Software |
Browse by Topic:
Micro Music - The ZX Spectrum Beepquencer
(EMM Oct 82)
Micromusic - Make music with the ZX81 (Part 1)
(EMM Dec 81)
Organ Talk - Computerscope
(EMM Sep 82)
Browse category: Computer > Sinclair
The Hungarian Revolution - Muzik Processor
(ES Mar 85)
Browse category: Expansion Board (Computer) > P.R. Computer
Feature by Peter Maydew
mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.
If you value this resource, you can support this project - it really helps!
New issues that have been donated or scanned for us this month.
All donations and support are gratefully appreciated - thank you.
Do you have any of these magazine issues?
If so, and you can donate, lend or scan them to help complete our archive, please get in touch via the Contribute page - thanks!