'A pirate's life for me' sounds like it's in A minor (and that's what multiple websites indicate) yet there's an A#/Bb in it. Where does that Bb come from? Does it modulate between F major and A minor somehow? It doesn't seem to resolve and the modulation sounds almost flawless. What's going on?
To me, the piece does not sound like being in A minor in any way. The websites linked do not look trustworthy, especially considering that notediscover.com claims "A minor" but actually shows the key signature of A major.
The first thing you should look at to determine the key of a piece is the final chord, which is obviously F major. The next thing you might look at is the chord the phrases end with:
- at 0:08, the first phrase ends on F (just F, but from the notes used before, it's clearly F major).
- at 0:12, the second phrase indeed ends on A minor, so there is an A minor chord in this piece, but it doesn't mean the key has to be A minor. A minor is a chord that is available from the notes in the F major scale.
- at 0:16, the third phrase ends on C major, and to me it is used clearly in a dominant function (it doesn't sound like the piece may end here, it sounds like the music must go on), so we are still in F major.
- up to 0:30: The fourth to sixth phrase are a repetition of the first three phrases.
- up to 0:42: A variation of the first three phrases, still the same chords
- up to 0:50: Another variation on the second and third phrase
- up to 1:03: Again the main three phrases, still (F (major), A minor, C major)
- up to 1:07: Now it gets interesting! It sounds like the first phrase again, but it ends with G as bass note, and the melody notes build a G7 chord on top (5th missing), but a natural B instead of B-flat. This might be the onset of a modulation (Let's guess: to C major)
- up to 1:11: Another phrase ending on G major.
- up to 1:15: This phrase ends on C major. This time, it sounds like the the tonic, not like a chord that leads toward F major. To me, this is a convincing modulation, and the guess seems right.
- up to 1:21: This phrase ends on D major. With F# in the final chord of phrase, this is definitely no longer F major. Maybe the piece is trying to do next step in the circle of fifths to modulate to G major?
- up to 1:24: Indeed, this phrase ends on G major, and D major was used as dominant of G major. I would call this second modulation.
- up to 1:28: Out of a sudden, the F# and B natural are gone, but we get to see a Eb instead. The phrase ends on g minor. I interpret this as continuing to modulate.
- up to 1:32: This phrase ends on Bb major, the parallel key to g minor. The g minor chord was just an intermediate step to get to Bb major.
- up to 1:37: This phrase ends on Eb major.
- up to 1:41: This phrase ends on C minor.
- up to 1:45: This phrase ends on E minor.
- up to 1:49: This phrase ends on F major (back home?).
- up to 1:54: This phrase ends on C major (used as dominant of F major again)
- up to 1:58: This phrase ends on F major, definitely the tonic here, so the piece modulated back to F major
- up to 2:02: This phrase ends on D minor, the parallel key to F major.
- up to 2:06: This phrase ends on C major, the dominant of F major.
- up to 2:11: This phrase ends on D minor, a variation of the phrase up to 2:02.
- up to 2:17: This phrase ends on F major.
So in this piece, the main key is fore sure F major, starting with a I-iii-V progression, followed by modulation to C major, G major, Bb major, some further key changes that change so quickly that for my listening experience, no new key is established until it gets back to F major again. The piece definetely does not modulate to A minor anywhere, as the dominant E major does not appear to establish A minor as key.
The last four phrases match the well-known western form of a period, in that it contains of two similar parts, the first one ending on the dominant chord while the second parts sounds similar to the first part, but ends in the tonic.