TECH NICHE

MIDI AND THE 128K SPECTRUM
An everyday story of interfaces

All was not well on the reviewers’ farm. For a start nobody had heard of the RS232 to MIDI lead promised faithfully in the users handbook that comes with the 128K Spectrum, not even the firm making up the leads — Sinclair were sure they knew all about it. In fact the man on the end of the cable maker’s phone, who dealt with our enquiries had not even heard of MIDI. Musical Instrument Digital Interface, we explained to him. The reviewer felt glum. What was he to do?

“Many people will be disappointed if you do not write about this wonderful interface,” sighed the Editor, “I’ll get Franco to make you one specially.”

The technical details in the 128 handbook were minimal. The reviewer thought and thought. “I know, I’ll ask that bright lad who writes TECH-TIPS to help me.” And so saying, the reviewer made many more phone calls to Sinclair and Simon. He learnt that the pins on the RS232 number from right to left as you look at them. “There are six pins and you must use pins one and five”, said a voice on the reviewer’s answerphone one day. Aha! Those must connect up to pins five and four on the five pin din plug that is used on the MIDI system he thought aloud.

When the PLAY mode is used on the Spectrum 128 it is possible to insert commands that convert pins 1 and 5 on the RS232 interface to MIDI output. MIDI, as you should know by now, is a universal standard by which all digital instruments can converse with one another exchanging note data, voice changes, key velocity, volume, timing and so on. Using the 128’s MIDI capabilities in this manner the 128K machine can be used to direct up to 8 separate synthesisers, or any synthesiser capable of receiving eight separate channels. Using MIDI, and the appropriate musical instruments, up to 8 notes can be played at any one time, which is a lot better than the miserly three notes that the internal sound chip allows.

When the letter Y followed by a MIDI channel number is included at the beginning of a note string, that string of notes is sent along the respective MIDI channel when it’s encountered by the PLAY command. There are sixteen MIDI channels to choose from, and most MIDI instruments will use some if not all of these. It is important that you check which channel a synthesiser is receiving on before asking it to play music sent down the line from the Spectrum — if the synth isn’t listening to the appropriate channel(s) the sound of silence is all you’ll hear.

16 CHANNELS

Synthesisers usually go into OMNI mode when they’re powered up — that is they receive on all 16 channels at once. If you only have one synth connected to the 128 then leave it in that mode and all should be well. Many synthesisers have a selection option between poly and mono mode. If you are going to ask it to play more than one note at a time, or receive more than one note strings at a time, then leave it in poly mode or there might be some unexpected results!

To begin with try something simple. The following is the bass line from Ghostbusters:

30 Let c$ = "M7O3N1c&c&$eeg&$b&$b&f&f&"
40 Play c$

(NB O is an upper case letter!)

RUNning this little program, plays the internal chip. If you now connect the computer to a MIDI synthesiser, switch on the synth and enter insert Y1 at the beginning of the note string your synth should now play the bass line along with the Spectrum’s internal chippery. By changing the receiving status of the synth to receive say, only on channel 2, you’ll no doubt notice that the synth has gone all quiet. This is because your 128 is only transmitting on MIDI Channel 1! However, if another synth is linked via the ‘MIDI Through’ port on the back of your first keyboard (or maybe via ‘MIDI Out’ depending on the make of equipment) you can run two strings of notes simultaneously and send each string to a separate synth providing the two synths are set up to receive on appropriate channels. Up to eight note strings can be run simultaneously. If you only have one synth then set it in OMNI mode.

TRICKS UP THE SLEEVE

The 128 has two other tricks up its sleeve. All V (volume) commands inserted in the string also affect synthesisers capable of sensing velocity, although too many Volume commands make for long strings! The other trick is the insertion of a Z. Follow a Z with the code for the function you require and the 128 should tell the synth directly to do anything that it will accept on the MIDI line, such as change voice, timbre and so on. Some specific codes for your synth are (or should be) listed in the handbook supplied with it, as the Sinclair booklet cheerfully states, going into no further detail.

Herein lies a problem. It is not abundantly clear which code work — I tried both binary and decimal coding with a variety of synthesisers, but both protocols failed dismally. Drum machines also rely on a constant clock frequency which seems to be missing from the 128’s MIDI port. I’ll keep trying to get the Spectrum to talk down the line with Z codes, and if anyone out there has cracked the problem, please drop me a line and I’ll share the knowledge.

A LITTLE UNFRIENDLY

At present the 128 does not seem to want to accept MIDI data, either. This would be of a little use to the integral sound chip, but in many respects such a facility could make the system a little more flexible in that two way software could be written. I suspect that the music and MIDI implementation were more of an afterthought on this machine, as a little more foresight would have enabled standard MIDI in and out ports to be fitted. If you want to output musical data to your printer, some rather tedious shuffling of information around inside the 128 and a replugging of peripherals is called for - a bit of a Kludge if you ask me.

Some sophisticated software is sorely needed to re-present on screen the music you are writing. It’d also be nice to be able to write from keys directly, (either QWERTY or via MIDI from a synth keyboard). Something akin to the Rainbird Music System would be much appreciated. Any chance, Rainbird?

The reviewer felt happier. The machine had performed almost perfectly. Now he could face the Editor and sleep easier knowing that CRASH readers could make music with their 128s without too many tears.