Open your DAW software.
Create a new MIDI track. Typically, this can be done through the File drop-down menu or by right-clicking on the track view.
Import the desired MIDI file into the new MIDI track. Each DAW program has a slightly different process for this function. Many have drop-down menu functions for importing audio clips and other files. Check the File drop-down menu for this function. In most DAW software, you may also use the copy-paste functions. Furthermore, some programs, such as Ableton Live, allow for drag-and-drop insertion.
Reconfigure the tempo settings for your project. The MIDI melody you import may have tempo and time signature settings that differ from the default. The DAW software may compensate for this automatically. If it does not, you will need to adjust the project's tempo and time signature settings to match the desired MIDI settings.
Connect a MIDI controller to your computer's USB port.
Open your DAW software.
Create a new MIDI track.
Configure the new MIDI track so that it receives input from your MIDI controller.
Enable the new track for recording. Usually, there is a button on the track that looks like a record icon, or is labeled with the letter R. This will enable the track for recording.
Click the record button on the DAW transport. The transport is the global control for the flow of the project. It is where you find the record, stop, and play buttons, among other things.
Play a melody on your MIDI controller.
Click the stop button in the transport once you are finished.