ZX Spectrum Synth Controller
In the last Micromusic article we were looking at a programme which arranged your Spectrum Beep's into some form of melodic order!
This month we will continue with the next logical step — using the Spectrum sequencer to control a synthesiser.
Two problems related to timing occurred during the development of the Beepquencer programme. Firstly, Basic is really too slow for musical applications, even a simple sequence can only be run at moderate speeds. Secondly, an interrupt is generated by the Spectrum several times a second to update the VDU status from memory holding up the task in hand until the interrupt routine is finished.
Critical timing loops (i.e playback) must therefore be assembled and run in machine code without interrupts.
The circuit diagram of the interface is shown in Figure 1. The INS8255 is an Input/Output device which has 3 ports. These can be configured as inputs, outputs or a combination of both. The chip is enabled, via the 74LS30 and half of the 4001, when A0-A4 and A7 are all high and IORQ (Input/Output request) is low. The two address lines A5 and A6 determine which port the data is to be sent to or received from, depending on WR (Write) or TO (Read) conditions.
The port addressing is as follows:
The controller circuitry can be built on a piece of veroboard, connected to the Spectrum via 20 way ribbon cable and the appropriate edge connector. Take care when connecting the address and data lines to the I/O device - any wrong connections will disrupt the operation of the computer.
The programme, shown in Figure 2, is basically the same as the Beepquencer published last month but with the machine code section added for the playback mode.
Line 22 loads the machine code data into memory locations 31501 to 31556. This data is contained in lines 24 and 26.
The start address of the sequence is split into two bytes and loaded into locations 32587 and 32588 (lines 2040-2060). These locations are read during the machine code routine to locate the Start address for the play mode.
To keep the programme simple the note length is not programmable but the 16 sequences can now hold up to 64 notes each.
Operation is similar to that of the Beepquencer but for the Play section. When a melody is playing, the interrupt is disabled and therefore the display and keyboard. To exit from this state trigger the 'Break' switch. This returns control to the basic and displays the menu.
To set the DAC load a 2 note sequence an octave apart e.g. 1C, 2C. The output can be tuned by ear, when connected to a calibrated VCO, or by using a voltmeter to monitor the CV output.
Once the board has been calibrated you can start composing.
Feature by Kenneth McAlpine
Previous article in this issue:
Next article in this issue:
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!