Out of sync with Rosegarden
If this is your problem. You have Rosegarden synced with any other application and are recording with a midi-keyboard. When you play along with the music in the synced app the monitoring is in sync but when you play back the recording the midi-track is out of sync in exact one or more measures. Rosegarden by default comes with a count-in of 2 measures. This can be changed in Settings -> Configure Rosegarden -> General -> Behavior and the parameter “Number of count-in measures when recording”. Set this parameter to 0 and use this settings when recording.