Really need help.. setting up the 5 Pin Midi socket to the Arduino board.

http://www.ebay.co.uk/itm/5-PIN-DIN-x2-CHASSIS-PANEL-FEMALE-SOCKET-180-DEGRESS-NICKEL-CONNECTOR-SOLDER-/330941507502

I have soldered the socket using the http://www.arduino.cc/en/Tutorial/Midi site.

I have also plugged it in the same way that is shown in the tutorial.

Now I want to know which one from the usb to midi cable I have to plug into the socket? is it the 'in' one or the 'out' one.

The main reason for this is because I want to use Flexiforce Pressure Sensor to send 'CC' continuous controller midi messages into a software called 'Synthedit' to control a sound effect 'slider'..

The code below is the one I am trying to use in order to achieve that..

int note;
const uint8_t midiContinuousController = 0xB0;

void setup()
{
  //  Set MIDI baud rate:
  Serial.begin(31250);
}

void loop()
{
  // Read the input on analog pin 0:
  int sensorValue = analogRead(A0);

  int pressure = sensorValue / 8; 

  pressure = min(pressure, 127);

  // Print out the value you read:
  Serial.println(pressure);

  if (sensorValue > 20){
 noteOn(midiContinuousController, 8, pressure);
  delay(100);
  }
  // Wait 100 milliseconds
  delay(3333);

}

void noteOn(int cmd, int pitch, int velocity) {
  Serial.write(cmd);
  Serial.write(pitch);
  Serial.write(velocity);
}

Now I want to know which one from the usb to midi cable I have to plug into the socket? is it the 'in' one or the 'out' one.

WHAT USB to MIDI cable ?

I have no idea what you are talking about.

We may need a schematic or photo of your setup.

5-pin MIDI socket PINOUT

In MIDI you always connect an IN to an OUT and an OUT to an IN.

In MIDI you always connect an IN to an OUT and an OUT to an IN.

I never worked with Midi but all the other protocols I worked with had standard for associated the plug gender with the type (IN/OUT) of the signal. The photo you posted is either an INPUT connector or and OUTPUT connector. The similar connectors I have seen on electric pianos where OUTPUT connectors (I think).

raschemmel: WHAT USB to MIDI cable ?

I have no idea what you are talking about.

We may need a schematic or photo of your setup.

5-pin MIDI socket PINOUT

This is what I was talking about..

http://www.miltone.net/products/usb-to-midi

raschemmel: I never worked with Midi but all the other protocols I worked with had standard for associated the plug gender with the type (IN/OUT) of the signal.

This is not the case with MIDI. A MIDI plug can be an input or output, same socket, same wiring.

This is what I was talking about..

http://www.miltone.net/products/usb-to-midi

Look at that photograph. The top plug has IN written on it and the one underneath has the word OUT written on it. You plug the IN plug to your Arduino with that code.

Grumpy_Mike: This is not the case with MIDI. A MIDI plug can be an input or output, same socket, same wiring. Look at that photograph. The top plug has IN written on it and the one underneath has the word OUT written on it. You plug the IN plug to your Arduino with that code.

Thank you Sir for your reply..

so 'IN' is the one I need to plug into the 5 pin midi socket in order to send CC messages with that code I posted correct?

Yes. Your code is sending stuff out so you connect it to an in plug on your adaptor.

Grumpy_Mike: Yes. Your code is sending stuff out so you connect it to an in plug on your adaptor.

I can leave 'out' out..

it is no use?

When you send stuff from your PC to your Arduino, then you connect the out one to an input socket on your Arduino. If you never do this then you don't need to use the out plug.

For a full discussion of MIDI see my book http://www.apress.com/9781484217207

Grumpy_Mike: When you send stuff from your PC to your Arduino, then you connect the out one to an input socket on your Arduino. If you never do this then you don't need to use the out plug.

For a full discussion of MIDI see my book http://www.apress.com/9781484217207

Thank you..

I want to use an acceleromoter, pressure sensor and a Potentiometer in order to control guitar sound effects using the software 'Synthedit'. Will your book be able to help?

How does synth edit accept its parameters? The book will tell you how to send MIDI from an Arduino from various sensors. There is a nunchuck project and a flex sensor project as well as pots. However I see the biggest advantage for you in the basic MIDI theory chapters, given the questions you are asking here.