Just by curiosity. What is the minimum of notes and chords i need to determine the key of a song?
It depends on how many different chords there are in the song. For jazz, the traditions of chord substitution, use of ii-V progressions, possible polytonality and shifting key centers may mean you have to look at a dozen chords and grok the chord movement to understand the key.
But for the overwhelming majority of songs you only need one chord, the final one. The last chord almost always resolves to the tonic.
As for the number of notes, I have a hunch that the overwhelming majority of songs end on a half or full bar of the tonic.
So let's assume that we're listening to a tune and there's no polytonality and no shifting of key centers and no modality. If the time signature is 4/4 then to determine the key by the notes I would either
This collection of notes will give me either the full scale or the strong notes. The strong notes for major keys are usually the pentatonic major scale, and for minor keys usually the pentatonic minor. With these notes plus the tonic in the last bar I've got the key.
So if we ignore the note harvesting and assume no modality, it's 2 notes: the 1 and the 3. If our collection of notes indicates either modality or an exotic scale then it could be up to 7 notes.
If we include the note harvesting then for a 32 bar song it's somewhere between 5 notes (chord tones) and 64 notes (1&3).
Although honestly, if I was listening to a song and wanted to find the key, I'd comp along until I gathered all the skeleton chords.
There isn't any hard and fast rule. The first thing is that the key signature narrows it down to two keys. So, for example, if there are no sharps or flats in the key signature, the key is either C major or A minor. Most of the time, the first few measures in the piece will establish whether you're in the major or minor key.
Beethoven's 5th symphony is a famous example of an intentionally ambiguous opening. There are three flats in the key signature, so it's either Eb major or C minor, but it's impossible to tell which from the first four bars. The first four notes could be either the top two notes of a Cm chord or the bottom two notes of an Eb chord. The next four notes are no help; they could be either the middle two notes of a Bb7 chord (and therefore the V7 chord in Eb) or the top two notes of the G7 chord (and therefore the V7 chord in Cm). Then, the next four notes end on a Cm chord, leading up to a strong cadence on the G7 chord. This establishes the piece firmly in C minor. So sometimes, you have to dig into the piece a bit before you know.
One way to tell whether a piece (at least in classical music) is in the major or minor key associated with the key signature is to look for an accidental that raises the 7th note of the scale. That's usually a dead giveaway that the piece is in the minor key. This accidental will be a natural in keys with three or more flats, a double-sharp in keys with five or more sharps, and a sharp in every other key.
Chords, I'd say two. One will be the tonic, and the other, usually, the dominant. There are songs that use tonic and sub-dominant, which, funnily enough, is the same relationship, but the other way round.Given a minor key, the dominant may well be major, so it's easier to determine.Obviously, the more the merrier.Working through a song, three could be enough to be accurate, but start at the end chord, which OFTEN is the tonic, you maybe don't need more than just the one ! This could turn out to be not the simple question it appears.
Note-wise, hope someone else will reason that out.Given some underlying harmony, there will be a simple answer,but I wonder whether you mean notes/chords separately or together...