MIDI is easy just go to the piano roll view and extend the notes: this will work unless you have a sound with natural decay that doesn't last the entire measure.
RealTracks has holds that may work.
If holds and/or MIDI with short natural decays you can convert the MIDI to audio then using Melodyne you can extend both RealTrack and audio:
https://www.celemony.com/en/start