Page under construction. Not for public use yet.

Info about the

Yamaha CX5M music computer

General info
Accessing the MIDI ports
Sound module adaptor for other MSX machines
Connector pinouts
Circuit diagram for the SFG-05 sound unit

Compiled by Eirik Lie

I am NOT a Yamaha employee, nor do I have any connection with the Yamaha corporation. The information on this web page is based on my personal use and programming of the CX5M since 1985.
Eirik Lie.

A description of the CX5M Music Computer:

The Yamaha CX5M was made around 1984-1985 and was based on the MSX standard, which was a great flop. It had a Z80 CPU and ran, apart from ROM BASIC, an operating system equivalent to MS-DOS 1.0, if you can imagine. However, it also had a built-in 4-operator FM synth (as opposed to the DX7's 6 operators), soundwise equivalent (and patch-compatible, I think) to the DX9, DX21, DX100, and FB-01.
The original CX5M could only be played with a proprietary non-velocity sensitive Yamaha keyboard, and not via MIDI. It could be upgraded, however. If you take a look under your CX5M you will see the bolted-on synthesizer unit. If you can read 'Yamaha FM Sound Synthesizer Unit II' and 'Model SFG-05', you have the upgraded version. There also was a later model called the CX5M II/128. These two latter versions were velocity-sensitive playable via MIDI.
You cannot use an RGB monitor with the CX5M, you only have an RF output to go into the antenna socket on your TV, and a 'composite video' output, also found on many TV sets and old PC monitors.
Software for the CX5M came in the form of plug-in cartridges. If you have the original CX5M, the only cartridges of any practical use would be: If you have one of the upgraded versions, however, you will be able to use it as an external MIDI sound device. You then also will need the 'YRM-502 FM Voicing Program II' cartridge to edit the internal sounds. The CX5M is 8-voice, 4-channel multitimbral without dynamic voice allocation. Storage of sounds is on cassette tape. Any tape recorder can be used, but you need a special DIN-to-minijack cable, originally included with the CX5M. There was also an external disk drive available, but it was terribly expensive and very difficult to find. When you boot the CX5M, it defaults to the ROM BASIC, with no access to the synthesizer unit. You have to type 'call music' to get access to the synth, 'call fmv' to access the FM Voicing program, etc.

I know the following plug-in cartridges for the CX5M:

The YRM-10x carts does NOT work with a disk drive.

Other Yamaha peripherals:

Third-party peripherals:

Go to top of page

Some frequently asked questions about the CX5M:

Q: Are there default patches I can play without editing?

A: Yes, "call music" will give you access to the 46 default patches. These are the factory patches of the CX5M (with the SFG-01):

(Names in parentheses refers to SFG-05 patches, when different)

For the SFG-01 model: You can step through the patches with the left and right cursor keys, or move 8 steps a time through the patch list with the up and down cursor keys. You may also assign the number keys on the qwerty keyboard to the patches of your choice. If you press SHIFT and, say, the "1" key, the currently chosen poly patch will be assigned to that key. You may then later only press the "1" key to access that patch again. Keys "1" to "5" works with the poly part of the keyboard, and keys "6" to "0" works with the mono part.

Q: I can't figure out how to "Unsplit" the keyboard.

A: By default, the YK-10 or YK-01 keyboard of the CX5M (when equipped with the SFG-01) is split at middle C in a poly and a mono part. You can swap the two sounds of the split keyboard by pressing the "U" key on the CX5M's qwerty keyboard. You can change the split point by pressing "K" on the qwerty keyboard, then the desired key for the split point on the music keyboard.
If you don't want a split keyboard, just set the split point to the highest or lowest key, then swap the poly and mono sounds if desired.

Q: Do you still use the FM sounds yourself?

A: Yes, it is an integral part of my studio. Most of the time I use it as a MIDI monitor with the "MIDI Macro & monitor" cartridge, and as a librarian of patches for my Ensoniq ESQ1 synth with my own software. I also use its sounds occasionally.

Q: If I type "call music" or "call FMV" will I get the music editors or are they on the external cartridge I don't have?

A: "call music" will turn the CX5M into play mode, no program cartridges are necessary. If it has the old SFG-01 unit fitted, you will not be able to do anything at all without the YK-01 or YK-10 keyboard. If you have the SFG-05 fitted (look underneath the computer) the CX5M will respond to MIDI IN signals on up to four different MIDI channels simultaneously.

"call fmv" will not do anything unless you have the FM Voicing cartridge.

Q: I can't figure out how to tell if I have the SFG-01 or SFG-05? I turn the unit over and there is nothing on the bottom.

A: If it isn't any information on the bottom, it's a SFG-01, sorry.
Are you able to get to the MSX opening screen? It looks something like this:

MSX BASIC version 1.0
Copyright 1983 by Microsoft
28815 Bytes free
Then you write "call music" and press the "return" key, and the CX5M should enter the normal play mode. Now, if the screen looks something like:
----[POLY]-- ---[MONO]----
PMS        0  PMS        0
AMS        0  AMS        0
[S]SUST  OFF  PORTA      0
you have the old SFG-01 sound module, and you will not be able to play the CX5M from an external MIDI keyboard, only from the proprietary Yamaha YK-01 or YK-10 keyboard.

However, if the screen looks something like:

VOICE  #1  13  EORGAN2
       #2  13  EORGAN2
       #3  13  EORGAN2
       #4  13  EORGAN2
you have the new SFG-05 sound module. You will be able to scroll down with the cursor keys and set the MIDI channel for incoming MIDI data.
If you have the SFG-01 you may only play it with the Yamaha YK-01 or YK-10 keyboard. If you have the SFG-05 you may also play it via the MIDI IN, say from another MIDI keyboard or your PC sequencer. The CX5M has some very good sounds, so I would recommend using it as a sound module for your PC sequencer.

Q: If I have the older sound module, I really can't control it via MIDI???? Why is this, it has a MIDI in socket???? It seems silly! I will have to look and see which version I have. Maybe I have misunderstood you here????

A: The MIDI IN socket on the older sound module will not respond to "note on" messages, but is required for connecting a DX7 synth when using the DX7 editing cartridge. (Actually, when the CX5M first appeared, this DX7 editing software was mentioned as the most important reason to buy the computer).

Q: I still don't understand what the midi in is there for though! Can it accept MIDI in information but just doesn't use it in the sound module?

A: That's right. The DX7 editing software cartridge allowed you to store and edit DX7 patches in the CX5M. This required connection of the DX7's MIDI out to the CX5M's MIDI in, and vice versa. The CX5M could receive the MIDI data allright, it just couldn't use it to play the CX5M sounds simultaneously. I agree that this is a major example of the CX5M's many shortcomings.

Q: I thought the SFG-05 only came with the 128K Yamaha CX5M II, but perhaps it was available separately?

A: Yes. The CX5M originally came with the SFG-01, then about a year later it was equipped with the improved SFG-05. The SFG-05 was also available separately (quite expensive) to owners of the original CX5M.

Q: I suspect it will be the older kind of module which is a shame. Midi out I can live without but no MIDI in, that is a problem!

A: Yes, a lot of the original CX5M's buyers felt cheated by Yamaha when they realized it could not be played by an external MIDI keyboard. Nor did it work with the (terribly expensive) disk drive. You had to buy the new SFG-05 sound module, as well as new program cartridges (at full price) to have the CX5M working with the disk drive.

Q: Crazy! Did they not try the disk drive with it? Seems kind of insane.

A: Yes, really insane

There also was a sequencer cartridge available, the YRM-301 MIDI Recorder. This software allowed you to play other MIDI units through the CX5M with any MIDI keyboard, while recording the MIDI data on four tracks. BUT... you couldn't play the internal synth with it! And what's worse: The dedicated YK-10 keyboard needed to play the internal CX5M sounds could not be used to play MIDI into the sequencer program! However, a small English company (Digital Music Systems Ltd., see more info above, in the general info section) made a cartridge with an eight-track sequencer program that could utilise the internal sounds, some additional on-cartridge sounds, as well as external MIDI modules, all playable and recordable in real time. Doesn't sound terribly exciting today, but in 1985 this was a very powerful sequencer. Previously you'd have to shell out about 3000GBP for an IBM PC to have anything like it. I took a bank loan of about 1000GBP to buy the CX5M, that was a lot of money in 1985.
BTW, the above mentioned English company also planned a sampling program for the CX5M. That would have been interesting: sampling on a machine with 32k of memory...

Question from: Phil Seabrook, Asheville, NC:

Q: I have the midi connections on my cx5m going to my game port on my pc via an adapter. I am wanting to trigger my pc midi sounds with the yk-10 keyboard. Is this possible?

A: Strictly speaking, yes. However, the YK-10 keyboard is not velocity (touch) sensitive, so it would not be very good for triggering MIDI sounds anyway.

Question from: Steve Moffett, Boston, MA, USA:

Q: I recently acquired a DX7 Voicing Program cartridge (labelled YRM-103) myself, and have been wondering what to do with it. It came with a DX7 I bought recently. I don't have a CX5M, but I hate to throw it away since these cartridges aren't made any more.
Since you seem familiar with the CX5M, I thought that perhaps you or someone you know could use this cartridge. If not, what would be the best way for me to find people interested in this item? I hate for it to sit around unused. From what I've read, it's a great item if you like to design programs for the DX7.

A: The DX7 Voicing cartridge is of course worthless if you don't have a CX5M to plug it into. I seem to recall, back in 1985, the YRM-103 program cartridge was listed as a major argument for DX7 owners to buy a CX5M computer. The DX7 was considered very difficult and cryptic to program, but the CX5M with the YRM-103 cart was supposed to make it more visual. I have never used the YRM-103 cartridge myself, as I don't have (and never had) a DX7. However, I've considered buying one (or preferably a TX7) to get access to some classic DX sounds, in which case I would appreciate having the YRM-103 cart. As I said, I've never seen the YRM-103 in real use, so maybe an application like SoundDiver could do the job just as good, or probably even better.

Q: I have a SoundBlaster 32 bit audio card that came with some MIDI software. Mainly I would just like to have a keyboard to play through that. I have hooked the CX5M up to my stereo out of the audio outs so I know that it works after the "call music" command, but I don't have it connected to a monitor or TV of any kind.

A: I recommend you to hook up a monitor to the CX5M. Without it, you are just fumbling around in the darkness. You may use any TV set as a monitor, just connect its antenna input to the "RF" jack on the rear of the CX5M, then tune the TV until you get the CX5M's screen. You may also use the "VIDEO" jack of the CX5M and connect it to your TV's "external video" input, or to any monitor with a "composite video" input.

Question from : "Michael A. Abelson":

Q: Many years ago I did quite a few arrangements on my CX5 Mark II. They are all in music composer format (.CMP extension). Do you know of any way to convert these files to standard midi (.MID) format?

A: Sorry, but I have not investigated the .CMP file format enough to be able to make a direct conversion. I can only suggest you record the MIDI out from the CX5M to another sequencer. You set one of the sequencers to external sync, and of course you must assign an external MIDI channel to all the tracks in Music Composer (the mdon=1, mdon= 2, etc. command).

Q: I want to program the SFG-05 synthesizer in Z80 assembly language or similar, without rom program modules (YRM 502 , YRM 504,etc.). I want to control the paramaters of synthesizer and MIDI in/out signals independently of the limitations of the preprogrammed ROM cartridges. I.e : to program non tempered frequencies,

A: I don't know how to do this. The only thing I've found out is how to access the MIDI port with assembler language. It goes something like this: To read an incoming MIDI message, you first read a specific bit in a specific ROM address to find out if a MIDI message has arrived. If so, the actual MIDI byte is found at another ROM address. To send a MIDI message you go the other way. See the source code below for details.

Q: Can I program it as a patch editor for my keyboard synth?

A: That should be possible, if you have a good knowledge of the SysEx protocol of your synth. Actually, you should be able to do anything that's possible to do with a box having just a MIDI in and a MIDI out. I also made a keyboard remapper and rechannelizer, for use with drum tracks originally made for a Yamaha drum machine on my Atari sequencer. The CX5M acted as a translator, so that the drum track played back correctly on a Roland drum machine on another MIDI channel. Well, things like this are easily done on most pro software sequencers these days, but not 10 years ago!

The CX5M should work with any MSX disk drive. I have tested it with a Yamaha and a Sony. The difference between the Sony and the Yamaha disk drive was the amount of memory needed for Disk BASIC. Using the Sony drive I get "24455 Bytes free" at startup, with the Yamaha drive I get slightly less. As I developed my program with a Sony drive, I tried to make as much RAM as possible available for storing of sequencer data. When I tried to run it with a Yamaha drive, I found the drive would use my program RAM, and the program would crash. I then had to rewrite it with less RAM available.

Q: Perhaps it would be possible to write a small program that sits in the MSX and wait for Note On data from the MIDI In port and then plays the note! Seems extreme though! It seems a real shame!

A: Perhaps it is possible, but I don't know how. All I have found out is how to read the incoming MIDI data and how to send out any MIDI data, by means of machine code programming. I have not found out how to access the sound module.

Question from: "Anders H.M."

Q: Du har et meget stort kendskab til Yamaha CX5M MSX computeren. Jeg har selv tidligere benyttet den musik-fremstilling, men nu har jeg solgt den. I stedet for bruger jeg nu en MSX-emulator (FMSX) på min PC. Selv om jeg har de fleste af Yamahas musik-cartridges liggende som software, kan jeg ikke benytte dem på FMSX, da den ikke emulerer SFG-modulet! (Den emulerer til gengæld mange andre musik-funktioner, bl.a. FM-PAC, som jeg dog ikke kender.) Ved du, om der eventelt er lavet en emulator til PC, der understøtter de MIDI og musik-funktioner, der er i SFG-05 modulet?
(English translation: I use an MSX emulator (FMSX) on my PC. However, it doesn't emulate the SFG sound module. Do you know if there exists an MSX emulator for PC, that supports the MIDI and music functions of the SFG module?)

Beklager, jeg har ikke hørt om noen slik emulator. Jeg tviler sterkt på om det overhodet er mulig. Jeg har skrevet assemblerprogrammer som adresserer SFG-05 modulen, og adresseringen må være forskjellig, avhengig av om modulen er plugget inn i en Yamaha CX5M, en CX5M II, eller en Sony HitBit. Jeg tror ikke MSX hadde noen standard på interfacet til modulen. Dessuten foregår all lydsyntese og MIDI-funksjoner i selve SFG-modulen, uten å gå innom Z80-prossessoren. Du skulle nok ikke solgt din CX5M!
(English translation: Sorry, I haven't heard of any such emulator, and I doubt if it's possible to make one. I have written assembler programs addressing the MIDI port of the SFG, but all MIDI functions and sound synthesis is done internally in the SFG module, far away from the CX5M's Z80 processor.)

Question from Arjan Sinnige

Q: I'm in need of a voicing program that supports the Disk-drive. I've heard that there was another voicing program other than the YRM-102, namely the YRM-103. Do you have this software and if so, does it support HDD. (and is there a possibility that you can copy this software and mail it to me.? I'm using a Philips NMS 8050 with 512Kb expansion which should be enough.)

A: The YRM-103 is the editor program for the DX7 synth. The YRM-102 is for programming the internal synth in the CX5M, and it doesn't support a floppy disk drive. The newer version is called the YRM-502. See also the list of all the ROM cartridges above. I can't imagine any of these programs support a hard drive. Anyway, all this software is on ROM cartridges, which means they can't be copied (at least I haven't found any way to do so). Even if they could be copied, the program code would probably be looking for itself in the ROM slot of the machine, and not in its internal memory. The only solution would be to copy it to another ROM cartridge, but I don't have the equipment to do that, nor do I know how to do it. Sorry I can't help you.

Question from: "Rob"

Q: I live in Australia, and have discovered an old Yamaha YK10 keyboard in very good condition. However, I do not have (or want) the associated computer. Can this keyboard be used with any other (modern) computer/sound card/ midi system? The connector looks to be special. Is there any interface through which I could use it as a midi controller?
Thank you for your help.
Robert Jarvis

A: Sorry, I don't think the YK-10 keyboard is of any use whatsoever without the CX5M computer.

Question from: KJD Dawe (

Q: I do have another question I wonder if you can answer. I found some of my old tapes containing song data that I had saved from the CX5M. Problem is I don't remember the file names. Is there a generic cload that will load up any song?

A: I have not used cassette for quite a while, but I seem to remember that if you specify a wrong or non-existant file name, the CX5M will display the other files it finds on the tape. If you start the tape from the beginning, and typing:
cload "mysing.sng"
the CX5M, as soon as it finds any files, will display, say:
skip: yoursong.sng
skip: hissong.sng
skip: hersong.sng
skip: mysong.sng

Hope this helps,

Q: I even thought there might be a couple of lines that take midi in that could be wired to a new midi in port but I assume that the synth was controlled directly over a number of lines without any sort of midi interface. It seems like the Midi ports and the synth were entirely seperate electronics!

A: Yes, I believe so. There was a program cartridge for the CX5M called the FM Music Macro. With this you could play the internal synth with a BASIC program:

10 _INIT
20 _INST(1)
30 _PHRASE(1,"cdefg")
40 _PLAY(1,1)
This would play the first five notes of a C major scale with internal synth patch no.1. To define a melody line with different note lengths you would have to write something like:

30 _PHRASE(1,"l8e.g16g4e.d16c4d.e16g.e16d2")
Doesn't encourage spontaneous music-making, does it? Come to think of it, it resembles the Csound programming language, which still is the preferred computer program among certain "legit" trained contemporary music composers.

Go to top of page

Sound module adaptor for other MSX machines

Question from: Brian McCalmont

Q: I have recently bought a mark 1 CX5M with a YK 20 keyboard from an auction, and unfortunately it does not work. I have had the power supply tested and it seems ok and there are no obvious signs of damage. I have an old Sanyo MPC100 MSX and I understand it is possible to maybe connect the sound module to this and use the YRM-102 cartridge as well. You mention in your FAQ's that they can be connected with a PCB er..... how? my electronics knowledge is sparse, can you make me one? and how much do you want for it? any help would be appreciated as I really would like to get the computer going in some form..... thanks Brian.

A: I don't have time to make the PCB adaptor for you. However, it is quite easy to do. First, do you know what a PCB (Printed Circuit Board) is? The motherboard in your PC is a PCB. The one you need for the CX5M is far more simple, though.

First, in an electronics supply store (a do-it-yourself-type store, like Radio Shack in the US), you buy a small piece of unprepared PCB. It is an epoxy (or something) sheet, about 1 mm thick, copper plated on each side. You will need a board 44 x 78.5 mm in size. The 78.5 mm side is to fit into the SFG, and the opposite side is to fit into the top slot in the MSX computer. However, the slot in the computer is shorter than the one in the SFG, so you'll have to trim down that side of the PCB to about 66 mm.

If you read this message with a monospaced font (like Courier or Monaco) the ASCII drawing below should give you an idea of what the PCB should look like:

I                                I
I                                I
I                                I
I                               /
I                              /
I                             /
I                            /
I                           /
I                          /
I                         I
I                         I
I                         I
The upper edge is 78.5 mm, the lower edge is 66, and the height is 44 mm.
The height of 44 mm is suitable for my Sony HitBit MSX computer. Your computer might be slightly different. Check this out before you cut the PCB to size.

Now, you will need connections from each pin on each side of the MSX top slot, to the respective pins in the SFG slot. To make this, you'll have to etch away some of the copper on the PCB, to leave stripes of copper connecting the pins in the slots. This is the most complicated part of the procedure, involving some chemicals whose names I don't remember right now. Ask in the electronics store for advice.

The PCB will now look something like this, as seen from the front of the computer:

Into the SFG sound module slot
I|||||||||||||||||||||||||       I
I|||||||||||||||||||||||||       I
I|||||||||||||||||||||||||       I
I|||||||||||||||||||||||||      /
I|||||||||||||||||||||||||     /
I|||||||||||||||||||||||||    /
I|||||||||||||||||||||||||   /
I|||||||||||||||||||||||||  /
I||||||||||||||||||||||||| /
Into the top slot of the MSX computer

Then, plug in, boot the computer, and type:
and press the return key.

Go to top of page

Accessing the CX5M's MIDI ports

As mentioned above, I made a librarian for storing patches from my Ensoniq ESQ1 synth on the CX5M's disk drive. The complete source code is available from this web page:

The code below is what I got from Yamaha's Swedish office in 1987. It shows how to send or receive MIDI using Z80 assembly language. I incorporated this into my own machine code program, then I used a compiler called Devpac (from the British software house HiSoft) to compile this into a .bin file, then with a Basic program I first loaded the .bin file into memory, then used the Basic program as a menu system which accessed the different functions in the assembler program. If you have any questions, feel free to ask me, but I have not programmed in assembler for a while, so I may not be able to answer all your questions.
The comments on the code is partly Yamaha's, partly mine, but mostly from Wes Williams from Somerset, England, who did some investigation into this code in 1999.

; first define constant values
STARTA	EQU	#9000	; where to put this program in RAM
BLOKK	EQU	#A000   ; where to put the data
MID_SR	EQU  #3FF6	;address of  MIDI status register on SFG
MID_DR	EQU  #3FF5	;address of  MIDI data register on SFG
PPIA	EQU  #A8	;port of slot configuration controller
SLMAPM	EQU  #03	;slot map value for SFG 
SLMAPR	EQU  #00	;slot map default value
ENASLT	EQU  #24		;?unused?
	ORG	STARTA		; tells compiler where to put program
	JP	START           ; go to the start of the program
JOB	DEFB #2			;JOB SELECT (read data)
; The MSX machine has a address range of 64K bytes.
; However it can change what appears in this range
; by moving devices in and out of the range.
; This method is called 'slotting'
START	DI			;disable all machine interrupts
	LD	 (SAVESP),SP	;save a pointer to the machines BASIC stack;
	IN	 A,(PPIA)	;get the slot mapper configuration value
	OR	 SLMAPM		;change the slot map value to map the SFG 
                                ;into the slot
	OUT  (PPIA),A		;configure the slot mapper
	CALL RESET	        ;run the reset MIDI routine
; Calls various routines deprnding on the value of JOB
; Job is set to 2 earlier
	LD	 A,(JOB)
	CP	 3
	CALL Z,RESET		; if JOB=3 then call the RESET routine
	CP	 2
	CALL Z,IMIDI		; if JOB=2 then call the INPUT DATA routine
	CP	 1
	CALL Z,OMIDI		; if JOB=1 then call the OUTPUT DATA routine
	CP	 5
	CALL Z,OIMIDI		; if JOB=5 then call the OUT/IN routine
	CP	 4
	CALL Z,SUMCHK		; if JOB=4 then call the SUM CHECK routine
	CP	 6
	CALL Z,O1MIDI		; if JOB=6 then call the OUT 1 BYTE routine
; if JOB is not any of these values then the BACK TO BASIC routine is done
; ERROR?: Call to Z,SUMCHK should be last - otherwise it will try to do
;        to do a O1MIDI if the sumcheck  was 6. But I'm not sure
;	 what 01MIDI is meant to do, but I suspect it just outputs the
;	 final END-OF-EXCLUSIVE byte of the message!	

;Leave this program and return
BACK	LD   A,SLMAPR		; reset the slot mapper value
	OUT  (PPIA),A		; configure the slot mapper
	LD   SP,(SAVESP)	; restore the stack pointer
	EI			; enable interrupts again
	RET			; return to basic
RESET	LD   A,#80	;	value to reset MIDI in SFG configure 
	LD (MID_SR),A	;	configure reset
	LD   A,#05	;	default value for SFG configure
	LD (MID_SR),A	;	configure 
	XOR  A		; 	set register A to zero
	RET		;	exit reset routine
IMSLP	CALL INMD		; call the INMD routine
	RET  C			; if carry bit is set then exit
	LD   A,D		; get the MIDI data
	CP   #F0		; is it a "SYSTEM EXCLUSIVE" message
	JR   NZ,IMSLP           ; if not try again
	LD   (HL),A		; move to buffer
	INC  HL			; point to next free area in buffer
	LD   B,5		; set up number of loops of IMSPL2
;read subsequent bytes of message
	RET  C			; if carry bit is set then exit
	LD   (HL),D		; move message byte to buffer
	INC  HL			; point to next free area in buffer
	DJNZ IMSLP2		; loop until full message read
	LD  IX,(DBFAD)		;  
	LD  A,(IX+4)		; get 5th and 6th bytes of message
	LD  D,A
	LD  A,(IX+5)		
	SRL D			; get MS bit of lower byte of message length
	ADD  A,#80              ; and a put it into the lower byte
IMSNX	LD	 C,A            ; form the message length for loop counting
	LD	 B,D            ; into BC 
	LD	 (DLEN),BC	; save message length
	INC	 BC		;
	INC  BC			; add two more bytes for checksum?
	;	LD	 BC,(DLEN)
	RET  C			; if carry bit is set then exit
	LD	 (HL),D		; move data to buffer
	INC  HL			; point to next free area in buffer
	DEC  BC			; decrement loop count
	LD	 A,B		;
	OR	 C		;
	JR	 NZ,IMLP	; test if BC=0, loop if not.
INMD	LD A,(MID_SR)		;get status
	BIT	 5,A		; 
	JR	 NZ,FE		;if bit 5 of status is set then Framing
	BIT  	 1,A		;
	JR	 Z,INMD		;if bit 1 of status is zero, not ready
yet,so loop
	LD	 A,(MID_DR)	;get MIDI data
	LD	 D,A		;move to D
	AND      #F8		; if message=#F8..#FF then
	CP	 #F8		; CANCEL
FE	LD	 A,#F0  ; 
	LD     (JOB),A  	; Use JOB to indicate failure
	SCF             	; Set the Carry to indicate error
	RET			; exit routine
OMIDI	LD HL,(DBFAD)		; point to message
	LD BC,(DLEN)		; get message length
	INC  HL			; point to next byte in message
	DEC  BC			; decrement loop count
	LD   A,B
	OR   C
	JR   NZ,OMLP		; test if BC=0, loop if not.
OPMD	LD   A,(MID_SR)		; get MIDI status register
	BIT  0,A		; test bit 0
	JR	 Z,OPMD		; if bit0 is 0,not ready yet,so loop
	LD	 A,(HL)		; get next message byte from buffer
	LD	 (MID_DR),A	; send message byte
	RET			; exit this routine
; forms the sum check of a message, and returns the value in JOB
SUMCHK	LD   HL,(DBFAD)		;point to data buffer
	LD   BC,(DLEN)		;load message length (loop count)
	LD   D,0		;set D = 0
SULP	LD   A,(HL)		; get next message byte
	ADD  A,D		; add to D
	LD   D,A		; and save in D
	INC  HL			; point to next message byte
	DEC  BC			; decrement loop count
	LD   A,B
	OR   C
	JR   NZ,SULP		;if loop count not 0 then loop
	LD   A,D                
	LD   (JOB),A		; move sumcheck to JOB
OIMIDI	CALL OMIDI	; send a sysex message
	CALL IMIDI	; receive a sysex message
O1MIDI	INC  HL 	; point two bytes further into message	
	INC  HL		;
	CALL OPMD	; output this byte

Go to top of page

Date: Thu, 25 Apr 2002

I just checked out your CX5M FAQ and I think, that I might have some needed info. Here is a text file, that describes, how to read keyboard and play music on assembler. (File is best viewed on MSX)



Connector pinouts

Q: Does the PSU (power supply unit) plug into the weird multi pin socket with all the pin holes? What Voltage is it? How much in milli amps does it need?

A: The PSU is a Yamaha NP 55130, and according to a drawing underneath it, the pinout is:

Between pins 5 and 9 there is a switch on the drawing. I am not sure what this means.

Q: Do you have any details of the sound module?

A: What kind of details? The pin assignments of the edge connector? I doubt you will have any use for this unless you are a very experienced machine code programmer and have a good understanding of how to design and build logic electronic circuits. The more trivial details you probably already know:

Q: Yes I was wondering about the pin assignments of the edge connector! I was thinking maybe I could wire it to a spectrum or something!

A: Maybe that could work. I once made a switch interface and AD/DA converter for the CX5M from a kit originally designed for the Commodore 64.
Anyway, here's the pinout for the edge connector IN THE CX5M (NOT in the sound module). "I" or "O" indicates input or output:

I am pretty sure the SFG sound module only use connectors 11-60. All MSX computers had a 50-pin slot on top for game cartridges, and I was able to connect my SFG modules to the game slot of a Sony MSX machine, essentially converting the Sony into a CX5M. If you can't find a power supply for your CX5M you may find any other cheap MSX computer to plug the SFG into. However, both the game slot and the SFG edge connector is female, so you have to make an adaptor. I used a plain PCB board that filled the full length of both connectors, and made connections from pins 1-50 in the game slot to pins 11-60 in the SFG. Strangely enough, both the SFG-01 and the SFG-05 worked this way in the Sony computer. However, the slot mapping was different in the Sony and the Yamaha, so I had to make different versions of my assembler programs for the different machines. In my studio I used to always have both the Sony and the Yamaha up and running, one of them running the ESQ1 librarian, the other running the Yamaha "MIDI Monitor" cartridge (very handy for fixing MIDI-related problems).

Question from: Michael Christian

Q: I recently acquired a second-hand CX5M with an old Tandy monitor. However, the composite video cable was not included and Yamaha has discontinued parts for it. I'm trying to rig up a cable and was wondering if you'd know what pins on the DIN correspond to video, audio, and ground. Alternatively, do you know if all MSX-compatable computers used the same type of Audio/Video connector and are any of these companies still making parts for them?

A: There were several local versions of the CX5M, having different video connectors. However, the CX5M2 had the same connectors as the CX5M, while the Sony HitBit MSX computer had a 6 pin DIN connector for the video and sound outputs. In my wildest fantasies, I can't imagine these parts are still being made. You may find some gathering dust in some music store, though.

CX5MU and CX5MC (US and Canadian version, respectively), has a 5 pin DIN connector:

Note that although this is a 5 pin DIN connector, it is NOT a MIDI jack. The pins are positioned slightly different. On a MIDI jack, the pins are forming a 180 degrees semi-circle. On the CX5M video connector, the 5 pins have a 240 degrees spread. You should be able to find this plug in an electronic supply store, like Radio Shack in the U.S.
Also, note that this connector will give you a composite video output. You cannot plug it into the antenna socket on your TV, you have to plug it into a video input. Most modern TV sets has this kind of input, either on an RCA or SCART socket (often called an "external input").
For the composite video output, you should only use pins 2 and 4 from the CX5M's video socket.

The CX5MF (French version) has an 8 pin DIN connector:

On all other versions the composite video and the sound outputs both are on separate RCA sockets.

Other pinout schemes for the CX5M:

Pinout for the cassette data 8 pin DIN connector (FSK 1200 BPS or 2400 BPS):

Pinout for the joystick 9 pin "D"-type connector:

Pinout for the printer 14 pin Centronics connector:

Pinout for the ROM cartridge slot (game slot, "I" or "O" indicates input or output):

Circuit diagram for the SFG-05 sound unit:

Click on diagram to download a more detailed version

Further information about the YM2151:

The YM2151 is the sound chip in the CX5M.
These files are in Acrobat format:

Other sources of information on the CX5M:
The Ultimate MSX FAQ
Go to top of page

Back to Eirik Lie's homepage
Also, check out my CD "12 Bilder"

This web page was made by:
Eirik Lie
Bjornerabben 9, N-0383 Oslo, Norway
Tel +47 22 50 23 14

Please include "CX5M" in the subject field of your email.

Last updated: August 17th, 2008