Receive midi without opto-isolator

Hi, guys! I want to receive midi messages from a DAW using a midi connector with Arduino. But in every tutorial that I find there is an "opto-isolator". Why do I need it. Can I connect pins from Midi Connector to pins on Arduino and receive data via Serial without opto-isolator?
Tutorial I talked about: http://www.instructables.com/id/Send-and-Receive-MIDI-with-Arduino/step9/Receive-MIDI-Messages-with-Arduino/

Thanks for help!

It's easier to deal with MIDI's balanced-pair signalling that way.

What do you mean by MIDI's balanced-pair? What does this opto-isolator do? Can I replace it with code?

Metalex:
Can I replace it with code?

No.

But you could save yourself from further embarrasment by typing "opto-isolator" into google.

I already did it and read about it, but I still do not understand why I need it and what it is doing in this circuit.

Metalex:
I already did it and read about it, but I still do not understand why I need it and what it is doing in this circuit.

The opto is there to isolate the ground of the input, i.e. separate the ground of your DAW device and the Arduino.

btw the schematic in that instructible has a 10K resistor R1 between pin 5 and 7, I removed it because with it my circuit was not working, I was using a 6N135 opto.

Metalex:
I already did it and read about it, but I still do not understand why I need it and what it is doing in this circuit.

The midi specification says that there can't be any direct electrical connection between devices. All midi devices are isolated via opto-isolators.

So... you don't need it, but it has to be there.

From:

Ground loops will cause horrendous hum, buzzes, and other noises, especially when connected to computerized gear or lighting equipment. The noises are caused by differences in voltage potential from one end of the cable to the other. The remedy, of course, is to run balanced audio lines and to NEVER physically connect the chassis grounds of different pieces of equipment together. MIDI instrument designers understand ground loops. In fact, a major design goal of MIDI, as seen in the electrical specification explanation in the MIDI Specification Document, is to prevent any ground loops that might occur with the MIDI cables. This is done by using a balanced current loop through an opto-isolator and only grounding the MIDI outputs. The MIDI IN connector is not grounded to the receiver's chassis. When done correctly, there are no ground loops and no hum or other noises caused by the MIDI setup.

Pete

Metalex:
but I still do not understand why I need it and what it is doing in this circuit.

You can get away without having it in some circumstances, but depending on how the sending device is wired up you can cause a short circuit, smoke and fire without it.
This is because the ground pin of a device is not always at the same absolute voltage level on different devices, so if you want to connect stuff and not worry about blowing things up then you have to have an optoisolator.

what it is doing in this circuit.

The clue is in the name, it is isolating a circuit from the other. How does it do it, well optically, the other part of the name.