Go Down

Topic: works: MIDI-IN: code + schematics (Read 117494 times) previous topic - next topic


Aug 19, 2009, 04:22 pm Last Edit: Aug 19, 2009, 04:23 pm by Titus Reason: 1
this code:
Code: [Select]
midi messages start with one status byte followed by 1 _or_ 2 data bytes, depending on the command

example midi message: 144-36-100
  the status byte "144" tells us what to do. "144" means "note on".
  in this case the second bytes tells us which note to play (36=middle C)
  the third byte is the velocity for that note (that is how powerful the note was struck= 100)

Well, that was what I wanted to hear!!!!!!!
"http://highlyliquid.com/midi-accessories/midi-connector-inline/midi-jack-inline.jpg is the same, and the other is MIRRORED"

So we will try that :D

Good luck debugging your things. If i can help(new to midi, but debugged quite a lot of other things. Robotics....

You saw the 36.
Strange that NO ONE mentioned it :O
it is a darn error, I think it is THE error why people weren't getting their stuff to work!


How would this be wired with a 4 pin optocoupler?


Aug 21, 2009, 03:16 pm Last Edit: Aug 21, 2009, 03:19 pm by Titus Reason: 1
Hi every one,

Today I debugging Andreas his schematics etc.
We made good progress, but got stuck later on.
As mattgilbernet said:

'm also having trouble with this. I've confirmed that midi is coming through the jack by removing the opto-isolator and putting an LED between pins 4 and 5 of the jack. I've confirmed that something is coming through the opto-isolator disconnecting RX and instead putting an LED between +5 and pin 5 of the opto-isolator. It flashes when I hit keys. Ive tried 38400 baud as well. The Arduino is just not receiving the Serial in RX. I've at least narrowed it down, can anyone provide any tips or things to try?

the LED tests show that everything is working, or at least signals are being passed, all the way up to Arduino's RX pin. At that point the Arduino seems not to recognize the signal.

We tried sending serial data from the pc to the arduino, and that worked. Arduino was able to receive that.

So the big question is:

WHY is arduino not receiving the serial data from my midi signal?
(p.s. the code never gets past the "if (Serial.available() > 0)" part)



take a look at the schematic of the optocouper's inside on page 1
Your optocoupler has no pin 3 and no pin 6 is my guess
so you'd  only need to skip the 100K Ohm resistor to ground.
The rest is the same
GL Titus


Hello everyone,

As Titus stated in the last post; we still have some problems with the RX of my Arduino.
I have an Arduino Duemilanove.
I use this with a M-Audio Uno Usb to midi device.
Also I downloaded MIDI OX to check whether my outputdevice works.
This works.

Everything works accept the incoming signal through the RX.
What are we missing? Are we using the RX pin correctly?
Can we use the usb-port as the poweradapter at the same time of the RX use? The usb is not connected to the PC, only to a AC adapter.

Thanks in advance,



(to titus)

Okay, thanks.

I hope to sometime make an animusic-ish thing.


AndreasViruly, Titus, what's the voltage coming on pin RX?


Tep, do you mean with the arduino connected, or without the arduino connected?
BTW, do you need to declare the Rx pin as an input, to lower the internal pull up/down resistor?

Could the voltage be to low for the Arduino to notice?
In that case you'd suggest lowering the 3k3? or making it bigger?

Andreas, could you measure the Voltage over the rx pin?


You don't really need the arduino to be connected.
Since it's standart serial communication, nothing to declare concerning the arduino pin.

Let see! You're perhaps having the same problem than me...
Just measure the idle and the busy voltage of the pin!
(Btw, it's perhaps easier if you can send something continuously like MTC, MMC, etc.)


are you experiencing the same as this guy?
In that case, we've got the same problem.

Did you ever got it working?
I personally think it;s the arduino.


I already got it working a few times ;)


so what did you do?
what did you replace? what other programs did you upload :O?


I used this schematic (the same than everyone I guess) with a 4N28 and a 1N4148.

I began with the simple code I posted again in the last pages.

...As you can see, nothing very special...


Hello Everyone,

What I did was the following.
Instead of linking the schematic to the RX of my Arduino, I put a LED between the incoming data and the 5V pin.

Here I received the following results:
During the idle midi-signal I received 0V.
Whilst playing only 1 note I got about 0,02V.
Whilst playing 2 notes at the same time I got 0,04V
Playing 3 notes around 0,06V and so on.

Is there an error?
What can we do  :-/

Thanks in advance,.



The voltages you're talking about are measured on the RX pin, right?


Can you please try it without the led?
I don't know where you measured, but my guess is after the voltage drop of the led  ;D

Go Up