The duration of a note is strictly a result of the time difference between when a given MIDI Note-On message is recorded and when a Note-Off message with the same note number is recorded. If a duration value is changed, it will result in the change of the time when the Note-Off message is transmitted. If the note start time is modified, both the Note-On and Note-Off times will be moved forward or backward by the same amount.