Sharp IR sensor to Midi cc message

Assuming you already have an Arduino and the IR distance sensor, plug it into an analog input and run the [u]Analog Read Serial Example[/u] to see if you're getting meaning/useful readings. (You're not going to read the distance in any meaningful units but you should get bigger/smaller numbers related to the distance.)

...Later on, there is a [u]map()[/u] function if you want to convert those numbers to useful MIDI values.

Then, there a couple of MIDI libraries for USB MIDI or regular serial MIDI. Try sending some MIDI messages under pure-software control with no user-input.

Once you can read the sensor and write MIDI messages, you can write some code tying those together.

I guess the Arduino should be output a continuous message.

You probably only need to send the changes.