Try to figure out if the problem is with Logic or with the System (connection, USB port, etc)
Next time when you lose the MIDI input, open the Audio MIDI Setup utilities app (in the Utilities folder):
- Open the MIDI Studio Window (cmd+2).
- Select the "Test Setup" icon in the Toolbar
- Now when you play your external MIDI Keyboard (which should be displayed on that window), you will hear a ping sound when OSX receives that MIDI Message. That means that OSX (your computer) receives the MIDI signal and your USB connection (power) is ok.
- If you don't hear the sound, then it means that it lost connection and you have to click on the "Rescan MIDI" button on the Tool bar. A currently disconnected device (which was connected previously) is still displayed in the window, but it is grayed out.
If OSX sees your external MIDI Keyboard but you still don't have connection, then you should further check in the Environment to trouble shoot Logic itself.
Tip
Here is another tip that I further describe in my manual "Logic Pro X - The Details". Go to the System Preferences and select the "Notification" item. There you find Logic Pro X in the left Sidebar. Activate the Alerts on the right.
Now every time Logic "want' to tell you something important", you will get a notification banner in the upper right corner of you computer screen, which is also listed in the OSX Notification section.
Just activate that preferences feature to see all the types of notification that Logic can send (Number of MIDI ports changed, Export completed, New Sounds available, download completed, etc)
Hope that helps
Edgar Rothermich - LogicProGEM.com
(Author of the "Graphically Enhanced Manuals")
http://DingDingMusic.com/Manuals/
'I may receive some form of compensation, financial or otherwise, from my recommendation or link.'