How to save/export as a MIDI file in GarageBand
You can get MIDI from GarageBand using these free application or browser conversion methods 


  One of the biggest drawbacks [of GarageBand] is the lack of built-in support for exporting MIDI data. (...) However, a nice guy named Lars Kobbe has put together a workaround/hack that extracts MIDI data from the reluctant clutches of GarageBand. 
  
  You can download his GB2MIDI Apple droplet script from his site: MIDI-Export in Apples Garageband. Here’s the direct download: GB2MIDI.ZIP
  
  source: Scott Troyer: Export MIDI from GarageBand


Kobbe also created an experimental JavaScript-based version of the GB2MIDI app which works directly in your browser. This is great because, if the application ever stops working (e.g. after updating your operating system), the browser version still works wonderfully!

Conversion Process

Once you have your MIDI performance in GarageBand, you may create a MIDI file (.mid) using the following steps:


Join the regions of the track you want as a MIDI file (command + J)
Convert that region to a loop (File > Add Region to Loop Library or drag-and-drop into loops area)
Find that loop (.aif) file you just created in your hard drive


/Users/User'sName/Library/Audio/Apple Loops/User Loops/SingleFiles 

Put the loop through the conversion process below


Application method: 


simply drag-and-drop it onto the GB2MIDI converter icon
Click "Run" when the GB2MIDI prompt pops up
Grab the freshly extracted .mid file (now found in the same folder where the .aif loop was)

Browser method:


Go to the browser version of GB2MIDI
Select "Choose Files" (or just drag-n-drop onto "Choose Files" button)
Click "Convert"
Grab the freshly extracted .mid file (now found in the download folder)




Now you can use the MIDI file for whatever you wanted. In my case, I'd open the MIDI file in Synthesia. Thanks to this process, I can make videos like this one.