MIDI Sequencer Project
Detailed Instructions on how to build your own ES&CM MIDI sequencer. (Software on tape).
Sam Griffith's hardware/software package for the Spectrum (Software on tape)
Having designed and used an analogue sequencer in the past, it was quite natural that after getting a MIDI equipped synthesiser I should want to sequence it. One thing leads to another and I ended up with a hardware/software package for the 48k Spectrum.
The system was designed with the Korg Poly 800 in mind, but obviously should work with most machines. I included provision for accepting external 9v trigger pulses, so you should be able to sync with your trusty drum machine, or whatever. It can handle 10 sequences, 5 of which can hold about 1000 notes, and 5 about 2000. It is not touch-sensitive. It is fully polyphonic, and sequences can in turn be sequenced, in a "program". Programs, or songs, consist of a list of sequence numbers and the number of times each should be played together with voice change information. Sequences, of course, consist of note and beat information. Sequences and programs can be stored on microdrive or tape. I shall go into how to use the sequencer after explaining how to put together the necessary circuitry.
I have done my best to make the hardware as simple and cheap as possible. The MIDI portion consists of the MC6850 ACIA (a synchronous communications interface adaptor) for converting the computer's parallel output to the MIDI serial standard, and vice-versa. There is also a clock for the ACIA, and an opto-isolator on the input to conform to the MIDI standard. The trigger input consists of a decoder which enables a buffer, allowing the level of the line from the external device to be read into the computer. Other information can also be read in using the spare buffers in the 74LS367. The decoder also generates other outputs which you may be able to use if you attach any other hardware to your machine.
The power supply circuit is based on the 7805 voltage regulator, using the 9v unregulated supply from the Spectrum, as the 5v supply is already loaded to near its limits.
The construction of the hardware is straightforward (so don't worry if you don't quite understand how the circuit works). Use sockets for the IC's, and take static precautions lest you strike the MC6850 dead. Use veroboard — the type intended for DIL IC's. Make sure the 10OnF capacitor is located very near the MC6850, and the 1uf capacitor very near the 7805, which should be given a heatsink. If you use an aluminium box to house the stuff, then that will do. To connect to the Spectrum you need a 28 way double sided 0.1" pitch edge connector with a key in position 5. You can get one with 9" of ribbon cable attached from Kelan Engineering Ltd. The IC's and crystal are obtainable from Technomatic amongst others, and the rest of the stuff should present no great problem. Follow the circuit carefully, taking care to sort out the lines from the edge connector properly. Use our edge connector diagram, not the one in the Sinclair manual, as that is back to front (!).
You can also make MIDI cables: these are 2-core screened cables, preferably twisted pair type, connecting two 180 degree 5 pin DIN plugs, pin 4 to pin 4, pin 5 to pin 5, and each pin 2 to the screen.
When you have put the hardware together, check it. Preferably several times with particular emphasis on the power supply. Don't forget to insulate the board from the box with a piece of cardboard or something. Also check that your solder joints are good and that none of the lines from the computer are bridged to each other. Then attach the device to the computer, fortify yourself as necessary, and hit the 'on' switch. Next thing is to turn it off presto if the display is not normal, and recheck your hardware to sort out the problem.
In order to run the programs you will first have to assimilate them into your system, as it were. If you have microdrives you should use the copier program supplied on Sinclair's "introduction" cartridge. Run the program and then type * MOVE "c";;"" TO "m";1 and start the cassette running. There are three files to be copied: a BASIC part, a machine code part, and a delightful little ditty for your system to play when it's all working. When the files have been copied onto your cartridge, type "LOAD*"m";1;"midiseq" and the sequencer should auto-run.
If you are using cassettes then load the first file - the BASIC program. It will generate an error and return to the BASIC command mode. Change the four occurrences of LOAD, SAVE & VERIFY from the microdrive version to the cassette version (i.e. remove the *"m";1;) Then save the program by typing SAVE "midiseq" LINE 3. Next copy the code file by typing LOAD "sq13C" CODE and SAVE "sq13C" CODE 28672,4000. The sequencer should then auto-run on your cassette. The demo can be loaded off the ES&CM tape. Incidentally, it may be a good idea to keep the original microdrive version in case you need it sometime.
You can try running the software to get some idea of what it can do, without having the hardware attached. If you have had trouble loading the files off the tape, try fiddling with the levels and using some treble lift. Also avoid earth loops and route the leads away from sources of interference such as mains wiring, transformers, televisions, and unnecessary digital devices.
When you have your hardware and software all lined up, you will understandably want to find out how to make it do something. First, the demonstration piece. Connect the interface's MIDI out to your synth's MIDI in, and vice-versa. Enter the sequencer and, having got the main menu, select the save/load option by typing 9, and then the load option, type P, and then "ESCM demo" followed by (enter) as the filename. If you're using a cassette manipulate tape as necessary. Then, when the file storage menu is redisplayed, type 5 for the main menu, type 0 to play the program followed by a 00 to indicate that it is to be played indefinitely (at least until you hit Q or S).
Wonderful, wasn't it? I hope so. If not, it may be either that you didn't hear anything or you didn't like what you heard. Well, in the former case you must have some hardware fault, and in the latter it may be changing the synth voice would help quite a bit, but otherwise you want to know more about the program.
a) all menu selections are made by typing a digit.
b) all numbers entered are 1 or 2 digits long. You needn't ever press (enter) for these. When a two digit number is expected and you want to enter a number less than ten you must type a leading zero. The prompts are reasonably helpful here.
c) voice numbers are Poly 800 style, 0 to 63 in octal (base 8) with digits 1 to 8 instead of 0 to7. 0=11, 63=88. Remember when you work out your conversions that your numbers may start at 1, not 0. Incidentally, Korg obviously use this system because it is easier to program at machine level.
d) filenames automatically have extensions -p (for a program) and -s (for sequences) added, making the maximum length of filename 8, rather than the usual 10. It must be terminated by an (enter).
e) notes, when entered from the keyboard or displayed, have the following syntax: e.g. C3#1 indicates that the note middle C# is to be turned on. The 1 indicates on, 0 off. The 3 indicates the octave - must be 0-5, although C6 is also allowed. This gives a range of 6 octaves C to C. Flats (b) also accepted.
0) Play program
Enter number of plays, a two digit number. 00 means play indefinitely. Press Q to stop play immediately, S to stop at end of sequence, C to proceed at end of sequence to next sequence in program (i.e. stop repeating current sequence.)
1) Enter program
Enter v for voice number, or 0 to 9 as a sequence number, and follow it with the number of the voice to be set, or the number of repeats, in the same way as for the program play command. Then repeat the process. To finish press S.
2) Display program
Same format as program entry.
3) Play sequence
Similar syntax to "play program" command, but the C key is obviously irrelevant, and you have to say which sequence.
4) Enter sequence
Enter a digit to select which sequence you wish to enter. Then press C or S to select entry method — computer keyboard or synthesiser.
For C enter note on/off events in groups corresponding to each beat, (enter) to move to next beat. S to stop (either as last event in a beat, or the only one). You'll see what I mean. Experiment with the program — it won't crash.
For S use synth keyboard. The program moves to the next beat when one or more notes are released in sequence, or you press (enter). This is a powerful algorithm, and it allows any sequence to be entered. A simple display of dots allows you to see the number of beats entered. This is the most machine-critical routine — if your machine has a slightly different MIDI implementation it may not work. In this case you will have to make do with using the computer keyboard for now. If you write in and explain any problems that occur, and any constructive suggestions you may have, to do with this and any other points, it may be possible to publish revisions if necessary.
5) Display sequence
Format as for computer entry.
6) Set clock type
Screen gives info. Initially internal clock.
7) Set internal clock rate
Screen gives full info.
8) Set transmit channel
Initially 1. It receives on all channels.
Takes you into file storage menu. This is largely self explanatory, but it is important to understand that all current sequences are saved (in compacted from) with the current program. If you haven't got microdrives, the inapplicable commands will generate BASIC error messages.
When the program tries to output more than one screenful of text at a time, the familiar "scroll?" message is generated by the Spectrum screen output routine. You should just press "y" or (enter) to this, or you will be returned to the BASIC command mode with an error message. This also happens if a verification fails, or as mentioned above. To recover from any of these, just enter RUN.
Well, I think it just remains for me to wish you the very best of luck with using the program creatively. I recommend using the ext. trigger input as it makes it much easier to generate powerful rhythms, which is one of the strong points of this type of system.
For £50 Sam will supply the finished hardware for the sequencer. Write to ES&CM for details if you're interested.
Feature by Sam Griffiths
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!