A computer keyboard can be a MIDI input device with a separate program.
Using a computer keyboard as a MIDI (Musical Instrument Digital Interface) device is a solution for the low-budget or cramped studio. Although playing it will not be as quick or intuitive as a musical keyboard, it will serve the task and is certainly possible. For a digital audio workstation like Sonar, a separate program will need to be downloaded, but otherwise the connection is fairly straightforward.
Instructions
1. Download a keyboard-to-piano bridge software such as Bome's Mouse Keyboard or KB piano. These programs transform the computer keyboard into a musical device. There is a trial version available from Bome's website. Install the program as instructed and launch it.
2. Left-click "MIDI-out" on the toolbar and select "Midi Yoke 1."
3. Launch Sonar and create a new MIDI track (click File select new track).
4. Click "MIDI input" on the right side of the track and select Channel 1.
5. Play the computer keyboard as you would a musical keyboard, experimenting with which buttons correspond to which notes or sounds.