Magazine Archive

Home -> Magazines -> Issues -> Articles in this issue -> View

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.

GENERAL SPECIFICATION



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.

THE HARDWARE



The Griffith's interface

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.

Interface circuit diagram
(Click image for higher resolution version)


AVAILABILITY AND CONSTRUCTION



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 (!).

Diagram for Spectrum edge connector


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.

THE SOFTWARE



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.

USING IT



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.

File storage menu screen display


SYNTAX (HOW TO TYPE THINGS IN)



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.

THE COMMANDS



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.

COMPONENT LIST

Semiconductors
MC6850 ACIA
74LS138 decoder
74LS367 3-state hex buffer
74LS04 hex inverter
TIL111 opto-isolator
7805 voltage regulator
IN 4148 diode

Resistors
10K
3K3
2x 2K2
2x 680R
2x 100R

Capacitors
1hF
2x 100nF
1uF tantalum
1000uF 16v electrolytic

Misc.
IC sockets: 24 pin, 2 x 16 pin, 14 pin — 8 pin
2 MHz crystal
2x 180 degree 5 pin DIN sockets
3.5mm jack socket
veroboard box
edge connector & ribbon cable

7) Set internal clock rate
Screen gives full info.

8) Set transmit channel
Initially 1. It receives on all channels.

9) Save/Load
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.

RECOVERY FROM 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.



Previous Article in this issue

Independence Day

Next article in this issue

The Moog Source


Electronic Soundmaker & Computer Music - Copyright: Cover Publications Ltd, Northern & Shell Ltd.

 

Electronic Soundmaker - Jun 1985

Donated & scanned by: Mike Gorman

Feature by Sam Griffiths

Previous article in this issue:

> Independence Day

Next article in this issue:

> The Moog Source


Help Support The Things You Love

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!

Donations for November 2020
Issues donated this month: 2

New issues that have been donated or scanned for us this month.

Funds donated this month: £43.00

All donations and support are gratefully appreciated - thank you.

Please Contribute to mu:zines by supplying magazines, scanning or donating funds. Thanks!

Monetary donations go towards site running costs, and the occasional coffee for me if there's anything left over!
muzines_logo_02

Small Print

Terms of usePrivacy