Audacity playback, from Yamaha keyboard via midi cable

Last night I ran my Yamaha EW410 keyboard through to Audacity via USB to AB cable, on my Windows 10 computer, Audacity has been working great for vocals, recording direct from Rode NT USB mic,
Basically wanted to record my track from my yamaha direct onto Audacity on PC, when I play single notes to record direct to audacity, I play back the audio and it plays back fine, but when I record chords, beats etc into a track onto audacity and play back the audio, it is totally out of sync, missing beats, speeding up, slowing down, just erratic.
I uninstalled and re-installed Audacity several times last night, I don’t think it’s the USB to AB cable as this won’t affect the audio quality , someone said it could be a midi clock problem, I have no idea what this is, or maybe could be my PC not man enough to cope.
Any ideas before I have a meltdown please?

Audacity doesn’t understand MIDI enough to manage actual music (AFAIK). I record my MIDI keyboard through the headphone connection.

You may be recording the computer internal microphone. Is it a laptop?