After recording midi my track is shifting at the beginning

When i playing and recording midi my track is shifting at the beginning… then i need to cut the first little part of my track.
How can i fix it?

Hi,

Most probably the very 1st not has been played ahead.

In general it’s not recommended to start a song at 1.1.1.1. Better to keep 1 or 2 bars free.