It's nice to be able to input note events from a hardware MIDI-enabled keyboard, rather than from a "virtual" mouse-based (or computer keyboard-based) one like jack-keyboard or vmpk. However, with software support, even non-MIDI (audio-only) sources can be translated to MIDI.
I have used Paul Brossier's excellent aubio package with mixed success in the past. Pitch recognition is a complex problem, and for MIDI purposes, even a 3% error in the detected frequency can swing the output by a semitone. Since most voices likely to be available as audio inputs (e.g. from an old keyboard, or from a real instrument) will have some amount of LFO, it's hard to get an error-free reading, at least without using a large delay line in the detector.
One way of easing this problem is to train the pitch detector on the entire range of possible audio signals to be recognized. For a 3-octave instrument, for example, this means training on just 36 waveforms. The detector can thus extract features from all potential inputs during training, and then work reliably even with a small buffer (which translates to a shorter delay between the input signal and the detector output). Of course, since the training signal presumably needs to include at least a half-period of the waveform, low notes in the input range will require greater latency (e.g. a C2 is about 65.4 Hz, or 15.3 / 2 = 7.15 ms half-period).