Using hold pedal with midi

How can I make a midi note continue for a set amount of time? I would like to use the acoustic nylon guitar (25) instrument, but rather than fading out I would like it to continue playing the note for 10 or 15 seconds and modify the pitch myself to simulate a person changing finger position in slow motion.

  
//Initializing the synthesizer
try {
  m_Synth = MidiSystem.getSynthesizer(); 
  m_Synth.open(); 
  m_MidiChannel = m_Synth.getChannels();
  m_Instrument = m_Synth.getDefaultSoundbank().getInstruments();            
  m_Synth.loadInstrument(m_Instrument[GUITAR]);   
  m_MidiChannel[DEFAULT_CHANNEL].programChange(GUITAR);
  m_wCurNote=60;
} catch (Exception ex) { 
  return; 
}

I’ve tried controllers 64 - 69 and they don’t appear to change anything.

 
// Use soft pedal to sustain note
m_MidiChannel[DEFAULT_CHANNEL].controlChange(67,127);
m_MidiChannel[DEFAULT_CHANNEL].noteOn(m_wCurNote,67);
 

When you send a note-on event to a MIDI channel, the note is played until you send a note-off event to the same channel with the same note number (or a note-on with velocity 0).
Don’t use the sustain pedal controller (64) for this (remember the sustain controller is global over the whole midi channel so all playing notes on that channel with hold until the sustain pedal is released and the playing notes are released with note-offs or note-ons with velocity 0).
The soft pedal is something completely different and is not even implemented in many synths (so probably not in the javasound too, although I’m not sure).
If the sound still does not sustain, I’d say the sound itself may be the problem (it’s probably not a sustained sound which makes sense for a guitar).
Did you test with for example a strings sound or any other sustained sound?
If you have a sustained sound playing, send pitch bender events to the MIDI channel to do what you want.

I must confess I haven’t done any MIDI stuff in java yet so this is just MIDI theory.

Erik