Thread: MK14 and MIDI
View Single Post
Old 22nd Aug 2022, 7:14 pm   #1
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,560
Default MK14 and MIDI

A while ago I mused over the idea of having my MK14 play one or more of my small collection of synths and tone modules.

Originally I meant to combine the original MUSIC BOX and SERIAL OUT programs from the manual to have the MK14 output MIDI note information at the MIDI serial baud rate of 31250. Phil_G and I had a brief discussion about it where we concluded that it would be quite difficult to software-time such a high serial baud rate with a 4MHz SC/MP.

I therefore built a hardware MIDI OUT interface, a virtual copy of the 6402 UART based user-port interface for the BBC Model B as shown on page 15 of R.A. Penfold's MIDI PROJECTS.

https://worldofspectrum.net/pub/sinc...DIProjects.pdf

Mine has a couple of extra tweaks - the UART's Transmit Buffer Empty pin is brought out to the controlling micro so that it can poll the UART to see if it is ready to accept the next MIDI byte. The original project was expected to be controlled by a BASIC program and the UART would have been able to get rid of each byte before being handed the next one. When the controlling device is running machine code it is highly likely to serve up data bytes faster than the UART can get rid of them, hence the need to be able to poll the UART.

I have also added a 4050 oscillator / divider chip with variable speed and that is so serve as a 'metronome' which outputs one cycle per 32nd of a whole note which can be polled by the controlling micro. This will relieve the SC/MP from having to software-time the interval between notes, making it easier to handle polyphony where each interval may see the start or end of no notes, one, two or three or more notes.

I've tested the interface initially using an Arduino as the controller and it works, but I was just about to start writing MK14 code for it when I saw this exchange in another SC/MP related thread...

Quote:
Originally Posted by Phil__G
Its almost like the SIO instruction with SIN & SOUT was designed for SPI

Originally posted by Silvester
Perfect for MIDI 31250 baud, which it can send faultlessly at full rate. Also 9600 Baud Rx/Tx fileserving is possible (albeit with 2 stop bits)
Silvester, if you have some working software-timed MIDI out code for SC/MP based on (say) a 4.00MHz clock, I would be interested to see it.
Attached Thumbnails
Click image for larger version

Name:	Midi_Out_Interface.jpg
Views:	89
Size:	65.2 KB
ID:	263420  
SiriusHardware is online now