Arduino midi in interface

Took me quite a while to finalize my midi in interface !

A lot of time wasted because I used a MCT2 optocoupler with  the “standard” 200 ohms resistor on the incoming signal.

The output form the optocoupler to the arduino was quit weak (thanks to my old oscilloscope). I finally found the solution in the  MCT2’s data sheet : the input LED needs a 60 mA current ! (as opposed to the 25 mA for the more classical 6N13x series). You can use a 100 ohms resistor : it works fine.

NewImage

I also wrote a little sketch to test the MIDI library : the led (attached to pin 3) blinks if a NoteOn, Program Change or a  Controller change is received.

You can also attach a piezo to pin 3 to play the note received

There is still a problem I have to solve : the library doesn’t responds directly after reset : it need to receive a program change first or a controller change before reading any data. Any ideas why ?