Little bit of MIDI help please

Hey guys, I'm developing a midi controller for a project that requires some smooth transitions between the notes.

Say I have a button on moving apparatus whose proximity from an IR sensor is measured, and while holding the button down move the apparatus, it would play the incrementing notes as the apparatus moved, however it produces a 'jagged' output, rather than a nice smooth 'slide' through the notes that I desire (think of the sound made by a theremin, that is what I am trying to achieve).

Does anyone know of the MIDI controls/messages I would need to set this up? I'm using microsoft GS wavesynth as my synthesizer?

I'm guessing you're going to want to look at pitch bend messages.

This is very good working code
http://tomscarff.110mb.com/midi_ribbon_controller/midi_ribbon_controller.htm

Would this also work with 2 identical notes

The code should solve my problems when dealing with moving notes, however if I, say, held down a button, without moving the slider (which currently produces a 'dadadadada') would it create a 'daaaaaaaaaaa'?