Assuming a piece stays in the same key (pretty basic for most Traditional music) you can identify its Key immediately with only three notes. Sit down with a piece of staff paper, and put in the first three notes successively up the scale (if you're learning by ear, and not written notation, assume the simplest starting note, C, and figure out the number of whole/half steps you have between each note.Once you have that, you can determine whether its major or minor by fitting it into the "pattern" of Major vs. Minor:
Root 2nd 3rd 4th 5th 6th 7th Root Major: R - 1 - 1 - 1/2 - 1 - 1 - 1 - 1/2 (Root again) Minor: R - 1 - 1/2 - 1 - 1 - 1/2 - 1 - 1 (Root again)
Now, looking at the notes you should be playing, and knowing that in order or precedence the most "instrumental" notes in a composition are:
Root - 5th - 4th - 3rd - 6th - 7th - 2nd
...you can plug in your song, and figure out if it's major or minor, all of the other notes and any accidentals, which chords (in that key) you are probably playing at a particular phrase, and finally, the rest of the accompaniment.
Easy, huh... :)