Jump to content
IGNORED

MIDI Muse, MIDI Interface design documents on github


ivop

Recommended Posts

Hi,

Some of you might remember this thread: http://atariage.com/forums/topic/269207-midi-interface/

 

I have thought long and hard about it, but I'm just not up to building and testing 20+ devices. I love designing new hard- and software, but committing myself to such a huge undertaking is something I cannot handle. So, I have uploaded the schematics and gerbers to github. They are here: https://github.com/ivop/midimuse

There's also the 'midimon' utility which dumps all events received to the screen. MIDI Muse is MIDI Mate compatible, except for the SIO port triggers. In fact, midimon relies on having an external MIDI clock.

 

Feel free to build one yourself. Or more and sell them. It's out there and free to use for everybody. In fact, I would like to encourage anybody who has the capabilities to build some for others!

 

New in revision C btw is the (optional) ability to mix down the stereo audio coming from the Waveblaster board and route it to SIO Audio IN.

 

Have fun!

 

I'm sorry I can't do it, but at least it won't be a "lost" project.

 

Kind regards,

Ivo

Edited by ivop
  • Like 12
Link to comment
Share on other sites

Thanks for putting this into the public domain Ivo :) .

 

I intend to incorporate at least part of this into my new 1088XLD project. I'm really looking at having on-board support for the DreamBlaster S2, and will probably also consider adding a header to allow MIDI Connectors to be a future add-on.

 

However I would like to simplify the required circuitry, and since I'm new to MIDI, I have a few questions for when you find the time.

 

Looking at the diagram below, what is the purpose of Q1 and Q2? Because it seems like the opto-isolator's transistor output would be sufficient all on it's own.

 

Diode D1's purpose? Is it really necessary (LEDs can usually take a higher reverse voltage/current)?

 

post-42561-0-83488100-1535388125.png

 

For standalone use of the DreamBlaster, it would appear that MIDI_OUT coming from the Atari would be all that's needed. What does the MIDI_IN on the DreamBlaster provide, and why the jumper selection between IN and OUT going to this?

 

post-42561-0-00749300-1535388135.png

 

And finally, what is the purpose of having 3 different clock divisions provided (DIV64, DIV128, DIV256), and which one would be used for the DreamBlaster?

 

post-42561-0-05706900-1535388824.png

 

Thank you

  • Like 3
Link to comment
Share on other sites

Q1+Q2 is an amplifier. Most (if not all) MIDI schematics I have seen use amps after receiving the signal. Similarly, output gets buffered. I think (not tested) you could replace the LS00 and Q1+Q2 by a hex buffer (something I have been thinking about for revision D). [see edit]

 

D1 is in every MIDI interface schematic I have ever seen, including with other optocouplers. https://www.google.com/search?q=diode+midi+schematic&source=lnms&tbm=isch

 

Waveblaster input select is there so one can select whether the WB board receives its events from the Atari or from an external source. Adding external power to the board, it can be used as a stand-alone Wave Blaster host. The third position disconnects the WB device entirely. You can drop this jumper if you want.

 

The three different clock dividers are there to accommodate different crystals (2, 4 and 8 MHz), just which one is available the cheapest :) If you fix the crystal type, the jumper can be dropped.

 

 

Edit: in that case, R4 and R5 are not necessary either. I'd keep the R6 pull-up.

Edited by ivop
  • Like 2
Link to comment
Share on other sites

I intend to incorporate at least part of this into my new 1088XLD project. I'm really looking at having on-board support for the DreamBlaster S2, and will probably also consider adding a header to allow MIDI Connectors to be a future add-on.

Yeah, I figured already you won't be able to have PCB mounted DIN5 connectors because of space restrictions :) But chassis mounted is more durable anyway.

Really nice to see this being picked up!

 

Edited by ivop
  • Like 2
Link to comment
Share on other sites

Thanks for the quick feedback :) .

 

Since I'll be replacing the 74LS00 with a 74HC04 or perhaps a 74HC14, That way I'll have an extra pair of inverters that be can be utilized to take the place of the transistors.

 

 

Yeah, I figured already you won't be able to have PCB mounted DIN5 connectors...

 

I'll probably still use PCB mounted DINs, but they'll be mounted on a secondary board with right angle attachment brackets, so only 5 holes would need to be drilled on the case (3 large holes for the DINs, and 2 small holes for the board mounting screws).

  • Like 2
Link to comment
Share on other sites

s'funny - I was planning the first card in the expansion box to be a midi card, and I already bought one of these :)

 

Ah well :)

 

Cheers

Simon

 

This doesn't really impact all that much on what you were planning, since only the 1088XLD will be able to accommodate the internal DreamBlaster board.

Link to comment
Share on other sites

s'funny - I was planning the first card in the expansion box to be a midi card, and I already bought one of these :)

 

My design gradually evolved and more features were added along the way. Wave Blaster port, external exact MIDI clock, pin header at the side, audio-in loopback, etc... I forgot to revisit the earlier parts of the design and simplify it. Probably because of the excitement of adding new features :) Perhaps I should have opened the design earlier and have more eyes look at it. Anyway, if you decide to design a MIDI card for your expansion box, mytek's simplification of the transistor based amp, can easily be incorporated.

Edited by ivop
  • Like 1
Link to comment
Share on other sites

Using a different opto-isolator allows for a very simple MIDI-IN interface...

 

MIDI_Input_Schematic.png

http://www.notesandvolts.com/2015/02/midi-and-arduino-build-midi-input.html

 

Adjusting the 4.7K resistor value allows for fine tuning the digital output signal. With a value of 3.3K being reported as being better.

 

Fabulous Fab12 on April 2016 stated...

Just received my 6n138 opto-couplers, measured various resistors configuration and to reply Timo question 10k gave me poor results as expected, around 5us rise time, whereas suggested 4.7k gave me about 1.35us ; much sharper edge.

Now the interesting thing is that I tried 3.3k and got 950ns rise time. It seems to be better and yet not too sharp (too sharp edges could cause other problems on a pcb layout from what i could read).
  • Like 2
Link to comment
Share on other sites

For older or badly designed equipment connecting to MIDI IN, you really need an amp after the opto-coupler. Or when (too) long cables are used. Or (too) many devices share a MIDI hub. Come to think of it, I think that's the reason why there's an analog amplifier stage instead of a TTL or CMOS buffer/inverter.

I originally had MIDI thru connected before the analog amp, that is U1 pin 5 right into the LS00 pin 12 & 13. It didn't work. None of my Yamaha and Roland synths saw any of the events coming "thru", no matter who was sending or receiving. That's why I moved the connection to after the Q1+Q2 amp.

http://atariage.com/forums/topic/269207-midi-interface/page-2?do=findComment&comment=3853788

It's all coming back to me now :D

  • Like 3
Link to comment
Share on other sites

For older or badly designed equipment connecting to MIDI IN, you really need an amp after the opto-coupler. Or when (too) long cables are used. Or (too) many devices share a MIDI hub. Come to think of it, I think that's the reason why there's an analog amplifier stage instead of a TTL or CMOS buffer/inverter.

 

I originally had MIDI thru connected before the analog amp, that is U1 pin 5 right into the LS00 pin 12 & 13. It didn't work. None of my Yamaha and Roland synths saw any of the events coming "thru", no matter who was sending or receiving. That's why I moved the connection to after the Q1+Q2 amp.

 

http://atariage.com/forums/topic/269207-midi-interface/page-2?do=findComment&comment=3853788

 

It's all coming back to me now icon_mrgreen.gif

I can see such a situation being very plausible..

Link to comment
Share on other sites

The 6N138 photo-darlington does have considerably more gain then just a single transistor opto-isolator. However it's slew rate is slow, hence the reason for the 4.7k biasing to GND, which drains the base charge that was keeping the output transistor in an active state after the LED had extinguished, thus promoting higher speed operation.

 

If you do a web search you'll see that this is a very popular isolator to use for the Midi-In circuit.

Link to comment
Share on other sites

I remember having ordered both but I received the CNY17 earlier, so based my design around that. Still have a tube of 6N138 in my collection, which came later. I must say, I also liked the smaller form factor of the CNY17, but I guess that gets negated by the need for two extra transistors. Anyway, by the looks of it and by its datasheet, the 6N138 should indeed be capable of driving a TTL or CMOS input. So I'd say, go for it! :)

  • Like 1
Link to comment
Share on other sites

I remember having ordered both but I received the CNY17 earlier, so based my design around that. Still have a tube of 6N138 in my collection, which came later. I must say, I also liked the smaller form factor of the CNY17, but I guess that gets negated by the need for two extra transistors. Anyway, by the looks of it and by its datasheet, the 6N138 should indeed be capable of driving a TTL or CMOS input. So I'd say, go for it! :)

 

Since I don't have any Midi gear to test with, and since you do have some 6N138's on hand, I was wondering if you could test out the circuit below to see if it works as well as your original set-up. No rush on this, since I have lots of time before making a decision on which way I wish to go.

 

The resistors shown in this circuit appear to be the preferred go to values.

 

post-42561-0-17792300-1535556800.jpg

For reference, here's what the 6N138's output signal looks like with no resistor from pin 7 to ground.

 

WTPA2_Bad_Note_Off.png

 

 

And here it is with a 2.4K resistor (Note, the time scale is different, but the byte is the same).

 

WTPA2_Note_Off_Emitter_Resistor.png

 

A very clean signal indeed :) .

 

O-Scope displays provided by Todd Bailey (discussion LINK).

 

--------

 

And an interesting variation using a Schottky diode clamp, that might make for a good alternative circuit.

 

post-42561-0-96265000-1535557235.png

  • Like 1
Link to comment
Share on other sites

 

Since I don't have any Midi gear to test with, and since you do have some 6N138's on hand, I was wondering if you could test out the circuit below to see if it works as well as your original set-up. No rush on this, since I have lots of time before making a decision on which way I wish to go.

 

The resistors shown in this circuit appear to be the preferred go to values.

 

attachicon.gif6N138_MIDI-IN_ckt.jpg

 

And an interesting variation using a Schottky diode clamp, that might make for a good alternative circuit.

 

attachicon.gif6N138_MIDI-IN_ScottkyClamp.png

 

Sure. I have to look where I left that tube of 6N138's though :) I plan to disconnect the RX line from a working prototype and breadboard your schematic and see how midimon reacts.

  • Like 2
Link to comment
Share on other sites

 

Sure. I have to look where I left that tube of 6N138's though :) I plan to disconnect the RX line from a working prototype and breadboard your schematic and see how midimon reacts.

 

Sounds good :thumbsup: .

 

BTW, I added some O-Scope readings to my previous post that were taken from a 6N138, both with and without a resistor to ground from pin 7. As can be seen, the opto-isolator's darlington pair doesn't do well without a resistor due to it's inherently slow switching speed without it.

Link to comment
Share on other sites

Bad news. Pokey keeps losing sync. A single missed bit can lead to undefined behaviour. At one point, it even thinks it receives on CH.4.

 

post-20947-0-85313000-1535561980.jpg

post-20947-0-74965300-1535561983.jpg

post-20947-0-87025700-1535561982.jpg

post-20947-0-87909900-1535561981.jpg

 

I tested with a 5m MIDI cable first and, thinking that might be the problem (although it should not be), after that with a 1m cable. Same problems. I don't have any Schottky diodes, so I can't test the other circuit.

 

Edit: this happens quite quickly BTW, within a few seconds. Even if you don't press any keys on the keyboard, it starts missing Active Sense events and resets every now and then.

Edited by ivop
Link to comment
Share on other sites

Success, I guess? First I lowered 470R to 220R. Didn't seem to do that much, or at least there were still a lot of errors. Then I removed it completely and it started to work! Ran a synth-demo tune through it without any apparent errors. Banging the keyboard randomly and very quick, did not reveal any errors either. And it stayed on CH. 1 :)

Edited by ivop
  • Like 2
Link to comment
Share on other sites

Success, I guess? First I lowered 470R to 220R. Didn't seem to do that much, or at least there were still a lot of errors. Then I removed it completely and it started to work! Ran a synth-demo tune through it without any apparent errors. Banging the keyboard randomly and very quick, did not reveal any errors either. And it stayed on CH. 1 :)

 

First of all I just wanted to say thanks for being willing to test this, and also for doing it so quickly :thumbsup: .

 

So no pull-up resistor means it's an even simpler implementation, and suggests that SIO's pull-up (4.7K?) is sufficient. Looking good.

 

At any rate, I think I'll keep the Midi-In interface circuit off my main board, and relegate it to the DIN interface board so that we don't have to worry about locking it down just yet.

 

Thanks again :) .

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...