How is your keyboard connected? Directly, or through a MIDI interface? What MIDI interface are you using? Or is it connected directly via USB? If so, what type of keyboard is it and are your drivers (if any) up to date? Have you tried changing the MIDI cables? These are the types of questions you need to ask and look into in order to sleuth out a problem like this.