Strange MIDI synth behavior - Page 1
Forum section: electronics / general

author: poot36
author_rank: Frequent Contributor
timestamp: February 17, 2025, 03:33:09 am
content: I have connected up a old Roland EM-10 synth to a 486 system with a game port to MIDI cable schematic I found in the datasheet for the sound card. It mostly works but I am having this strange behavior that when I play the DirectX MIDI external synth test and then I play another standard MIDI file (canyon.mid for example) it does not sound correct during some parts of play back. This can also happen when I play other MIDI files back to back as well. I am running Win 98SE with the default installed DirectX. I have to power cycle the synth to fix this issue. I will admit that I did not have a 270 ohm and a 220 ohm resistor to hand when I built the interface so I used a 500 ohm one on the positive rail to the MIDI jack. I don't think this will cause any issues but I could be wrong. I also used a 2.3K resistor for the pullup for the transistor in place of a 2.2K resistor but I really doubt that would be the issue here. I checked the rise and fall times on a scope and they are in the sub 250 nanosecond range so I think that is fast enough. I have also omitted the filter caps to ground as I don't have those values either. I have attached the relative section of the circuit from the datasheet.

author: Kean
author_rank: Unknown
timestamp: February 17, 2025, 08:46:51 am
content: So if you replaced the 220R (R3) and 270R (R2) resistors with 500R that would mean you are only sourcing less than 5mA instead of nearly 10mA for the MIDI out.i.e. 5V (from game port) - approx 1.3V (optocoupler Vf) = 3.7V.3.7V through 1000R total (your values) is 3.7mA.3.7V through 490R total (original schematic) would have been 7.5mA.It is a long time (30+ years) since I made any MIDI projects, so I checked the MIDI spec and it says a minimum of 5mA.Depending of the optocoupler in the Roland synth, the Vf might be higher and your changes are just not generating clean enough transmissions at 31250 baud.I recall having a bunch of optocouplers back in the day that just couldn't cut it for MIDI, but back then I relied on getting most of my parts for free.You can easily make lower value resistors by paralleling a couple of them e.g. two like values to get half the value, such as 2 x 510R in parallel gives 255R.I doubt the 220R or 270R values are at all critical, but doubling them seems far too much.If anything I would just remove R2 completely if you don't have C1 and C2 installed, and with R3 of 270R to get about 13mA or a max of 510R to get about 7mA.Oh, and where are you getting 500R and 2.3k resistors? They are not in any of the normal preferred values, even the E192 series.

author: pcprogrammer
author_rank: Super Contributor
timestamp: February 17, 2025, 10:48:16 am
content: Quote from: Kean on February 17, 2025, 08:46:51 amThe way I read it, is that he replaced the two resistors with a single 500 ohm resistor to the supply rail, so no R2. Current should be fine for proper midi working. The two capacitors to ground are not needed to make it work properly either.Quote from: Kean on February 17, 2025, 08:46:51 amGood point. Maybe he is using a potentiometer. (trimpot)Quote from: poot36 on February 17, 2025, 03:33:09 amWhat is it that sounds incorrect during playback?

author: poot36
author_rank: Frequent Contributor
timestamp: February 17, 2025, 05:20:06 pm
content: I used a single 500 ohm resistor in the positive side to the MIDI jack. The negative switched side has no resistor. I got to 2.3K for the pullup by paralleling two 4.7K resistors as that was what I had on hand. Given that they are 5% tolerance that is the value I measured with my meter. The playback issues I have had are missing instruments, too quiet instruments, corrupted and incorrect instruments. It seems to get worse the more MIDI files I play almost like it is not getting reset or something. I am using Windows Media player to play the files. I also have had the volume go to full even when I have turned it way down on the synth before playing a song (this happens without having played another song beforehand) I assume this may be normal as not all MIDI files do this.

author: pcprogrammer
author_rank: Super Contributor
timestamp: February 17, 2025, 08:02:01 pm
content: Within the midi file there can be program change information, or even sysex information that changes settings on the keyboard.Maybe an idea to read up on midi first.It can control 16 channels, and if the keyboard supports this it can be different then expected. A midi file can be dedicated to a specific keyboard with a specific set of sounds, and when these don't match things can sound strange.The midi interface itself should be fine with your modifications. The output is just driving an optocoupler on the input of the instrument. As long as the current is high enough to turn the LED of the optocoupler on and the transistor of the optocoupler off, it will work.

author: poot36
author_rank: Frequent Contributor
timestamp: February 18, 2025, 12:17:41 am
content: Thanks for the information, I am going to guess that this synth is not the best option for playing back MIDI music from old DOS games then. I just assumed because it stated GS and GM on it that it would work. I was kind of hoping it would be a budget SC-55 but I guess I am wrong.

author: poot36
author_rank: Frequent Contributor
timestamp: February 18, 2025, 02:35:39 am
content: Also not sure if this is a problem or not but I have around a 5 foot cable from the game port to the MIDI conversion circuit on the game port side.

author: Kean
author_rank: Unknown
timestamp: February 18, 2025, 04:47:44 am
content: Based on your description it really does sound like you are getting corrupted transmissions so it is not only playing the wrong notes or instruments, but over time also screwing with other settings. There is no error detection or correction in the standard MIDI protocol.Maybe there is a fault in the receiving optocoupler. A 5 foot cable should be OK, but it depends on the wire gauge as with very fine wire you might get a significant voltage drop.As a first step I'd still try increasing the loop current by reducing that 500R to 270R or so and see if it has any impact.

author: CaptDon
author_rank: Super Contributor
timestamp: February 19, 2025, 12:33:04 am
content: Absolutely up the drive current to the opto isolators. 5ma. works?? Yes but closer to 10 is better. Canyon.mid should play fine no matter what. It always has on every system and iteration I've ever owned or operated. BE AWARE there are some chinese USB to MIDI cables that are PURE GARBAGE. Don't buy them!! They are the ones with the blue plastic blob with a red, green and blue LED. I ran a 15 pin gameport dongle to a Yamaha FB-01 absolutely trouble free!! Your MIDI output stream may be getting corrupted due to CPU cycle stealing and so forth. There are some really good MIDI integrity test programs out there!!! Need XP or better to run them however. That is how I discovered the pure trash MIDI to USB cables were corrupting my data. Drove my Yamaha MU-80 crazy, forced me to do a factory reset several times. Crushed the crap interface cable in a vice just for chuckles!!!

author: poot36
author_rank: Frequent Contributor
timestamp: March 22, 2025, 04:11:34 pm
content: Sorry for the late reply, for some reason the notifications had been going into my spam folder.I did some more research and found that windows media player does not send a GS GM reset command after it finishes playing the file.This would leave the synth in a unknown state due to what ever parameters the previous MIDI file had sent to the synth.It is not CPU bound as when I had the resource monitor open I was only using a few % of the CPU when the MIDI file was playing with WMP.I found this MIDI playerhttps://www.vogons.org/download/file.php?id=213092that does send the reset command and for the most part everything has been working as intended.It is way more resource intensive but it does work better.I have also heard that Winamp can also send the MIDI reset command but I don't know if it will run on this old of a system.I did measure the current out of my circuit on my old DMM and it was at least 7ma based on the slow update rate and averaging of my meter.