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);
}
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:
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.
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?
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.
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.
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.