You can check this thread out.
There are plenty of Youtube videos showing how it can be done using a MIDI loop back.