MIDI glissando effect? (Pitch bend more than 2 semitones?)

So, I've got a capacitive touch keyboard going using cardboard, aluminum foil, 3 MPR121 breakout boards, Arduino Nano with the MIDI.h library, and some MIDI setup that ultimately turns the Arduino into a controller for iPad apps. I can get notes (yay!) but now I want a button that puts it into "glissando mode" where it slides from one note to another when I slide my finger along the keys.

My basic thought is I would have it play the note I start on and then pitch bend however far my finger goes, but I can only get 2 semitones with MIDI.sendPitchBend () and if I try to go further it just rolls over, i.e. if I go higher than 2 semitones it jumps to 2 semitones down and continues from there.

Is there a better way to get this glissando effect, or some solution so I can do it this way?

Play the first note. Pitch bend it up 1 semitone. Then play a note 2 semitones up and pitch bend it a semitone down. So it matches where the last note left off. Pitch bend that note up to a semitone high and then go to the next note 2 semitones up and bend it down.

Pitch bend range is set by the synth, not the midi controller. +/- 2 semitones is common but not standard.

I think the effect you're after is normally called portamento, if that helps.

Delta_G I thought about doing that, but wouldn’t that re-attack the note every time it jumps even if it’s the same pitch?

GypsumFantastic yeah, figured the portamento thing out after I posted this – I’ll look into that. Also saw a bit about the pitch bend range synth settings, but changing that on mine doesn’t seem to have any effect when receiving from Arduino.

Pitch bend range is set by the synth, not the midi controller. +/- 2 semitones is common but not standard.

Odd, I can pitchbend up to 6 octaves from the Arduino.

// set up Pitch bend sensitivity
  controlSend(101, 0);
  controlSend(100, 0); 
  controlSend(6,72); // set to 6 octaves
  controlSend(38, 0); // and zero cents

// then some code and send the pitch bend message

void sendPB(int pb){ // send pitch bend message pb being a 14 bit int
  Serial.write( (byte)0xE0 | channel);
  Serial.write( pb & (byte)0x7f);
  Serial.write( (pb>>7) & (byte)0x7f);
}