How can I just record some piano midi and let Cubase follow?

Both methods are OK but what if you could tap the tempo with your foot while playing, and use that info for feeding method #2 ? That should give you the most accurate tempo map since you were tapping it as you felt it while playing your part, instead of trying to recreate it afterwards.

Just for the sake of explaining the method I’m going to use the sustain pedal (CC 64), although you probably will want to use another controller, one that doesn’t interfere with your playing. Depends on what’s available to you on your midi keyboard.

So you start recording, playing the part while tapping the sustain pedal every quarter note. When finished, duplicate the midi track, call it “tempomap” or so, and remove all the note info in the key editor, just keeping the controller data. Now apply the Logical Editor (screenshot attached) to this midi part. Note that we use the “Insert” function.

This will transform every sustain pedal’s downstroke (CC64, values 127 only) to a new note. Now apply vic’s and thinkingcap’s method 2.