There are many reasons why you may not hear music play when you press keys on your MIDI keyboard. We will explore many of the possibilities below:
1) There are no Instrument Tracks in your project. To add an instrument track, click on Track->Add Track->Add Instrument Track. This will add an instrument track to your project, containing the default instrument.
2) Your instrument track may not have an instrument on it. Check the instruments that are on the track. If your default instrument (File->Preferences->MIDI) no longer exists, you may not have any sounds on your track.
3) Your instruments may be muted, their volume may be set to zero, or your track volume (or master volume) may be set to zero. Every instrument in your instrument dialog has a checkbox next to it that can be used to mute and unmute the instrument. Make sure at least one instrument is unmuted on your instrument track. Check all of the volume controls - instrument volume, track volume, and master volume, and make sure they"re all turned up.
4) Your MIDI device may not be selected as your current input. To to File->Preferences->MIDI and set your MIDI Input Device to "All Midi Devices."
5) Its possible that your MIDI or USB cables have become unplugged, or your keyboard is turned off. Check all cables. Make sure USB cables are connected to both the computer and the MIDI keyboard. If you"re using MIDI cables, make sure your keyboard"s MIDI Out is plugged into your computer"s MIDI In.