This app may assist you in troubleshooting this issue (i am in no way affiliated with this app) ...
MIDIMonitor
Try this ... remove the contents of the following two folders by moving their files into to two new folders on your desktop:
Macintosh HD ~> Library ~> Audio ~> MIDI Drivers
Macintosh HD ~> Users ~> [Your User Name] ~> Library ~> Audio ~> MIDI Drivers
the second location above is hidden on Mac OS X 10.7 and above. Hold the Option key as you click on "Go" in the menu to show your User Library.
These are the places where third-party MIDI drivers are stored. If they have become corrupt, or they haven't been installed correctly, removing them and starting over may help.
Restart your computer.
Try your MIDI device again.
If the symptom has been resolved, you should reinstall each of these drivers by visiting the home page for the respective device manufacturers. Note, if your MIDI device Class Compliant, it doesn't require any extra drivers to be installed.
Make sure you check that the keyboard is work properly before you trash the files you had moved from your MIDI Drivers folder to your desktop.