Reproducing note_slide with midi

Hi,

I’v been trying to recreate note_slide using midi without much success. Any help is much appreciated. I want to recreate:

c = play 60, note_slide: 1
control c, note: 70

… using midi. I’v been trying to recreate the sound with portamento setting for Yamaha XG midi bank like:

use_midi_defaults port: "loopmidi", channel: 1
use_real_time

# Not working

midi_cc 65, 127
midi_cc 5, 50

midi 60, sustain: 2
sleep 0.5
midi_cc 84, 70

sleep 3

# Or between on&off ?
# Not working

midi_note_on 60
sleep 0.5
midi_cc 84, 65
sleep 0.5
midi_cc 84, 70
sleep 1
midi_note_off 60

But it just plays one note. I got pitch bend working but sliding is limited to next few notes:

# This is working

midi 60, sustain: 2.0

in_thread do
  sleep 1
  100.times do |i|
    sleep 0.005
    midi_pitch_bend i.to_f/100
  end
  midi_pitch_bend 0.5
end

Help newbie out here. As i understand portamento should slide between two currently playing notes. So something like this should work … but im missing something:

use_midi_defaults port: "loopmid", channel: 1
use_real_time

midi_cc 65, 127
midi_cc 5, 90

midi_note_on 50

midi_cc 84, 50 # Portamento Control is transmitted specifying the Note On Key of the currently-sounding note

# When a Portmento Control message is received, the currently sounding pitch will change with a Portamento Time of 0 to the next Key On key on the same channel

sleep 1
midi_note_on 65
sleep 1
midi_note_off 65
sleep 1
midi_note_on 60
sleep 1
midi_note_off 60

midi_note_off 50