When you see that A Minor has the same key signature as C Major, what you are seeing is the "natural minor" scale. This is simply the notes implied by the key signature, and so is identical (but down a third) from the relative major. If you play purely in the natural minor, you are really closer to the Aeolian mode than a minor key.
There is also the "harmonic minor" and "melodic minor" which, in common practice period, are much more commonly used than natural minor. Harmonic minor has a raised seventh. This makes the dominant (V) triad a major triad which increases its need to resolve to the tonic (I). It is used for harmonies (obviously based on the name) for this reason, but it makes the step from 6 to 7 an augmented second (i.e. minor third) so its isn't used melodically very often. Which is why there is also a Melodic Minor.
Melodic minor is tricky because it varies depending on whether the melody is ascending or descending. Descending is easy, it is identical to natural minor. Ascending is similar to the harmonic minor with its raised seventh (creating what is known as a leading tone, i.e. a half step below the tonic that wants to resolve up to the tonic.) But the ascending scale also has a raised sixth, which eliminates the augmented second between 6 and 7.
Are there examples of this in music? Or is it just something invented to test young pianists in exams?
Indeed. For anyone that is not sure about that, take a piano (like this virtual one[1]) and play a scale of all the white notes starting with C.
The play a scale of all those same white notes, but starting with A.
You should immediately notice that the second version is in a minor key (sounds "sadder").
Follow-up question: how are phase of the scale and the piece of music synchronized? When I think in terms of a wave, I could Fourier-Transform it into sines or in cosines, or any other phase-shifted variant (a * sin(nx + const.))?
Is it always the first note of the piece of music that "anchors" the piece in its scale?
Does that question even make sense? :-)
First of all, this is a mathematically undecidable problem, as in that there exist tunes that could be in multiple scales. The extreme example is a melody that consists of only a single note. Ridiculous, but as a fellow nerd I'm sure you can see how I could call a single note a melody. So we have to lose the phase metaphor here a little bit.
Most songs "anchor" with the last note. If you really can't tell whether a song is in major or minor (songs in major are a bit happier, jollier; songs in minor a bit sadder and more melancholic), going for the very last note (or the last note of the chorus, if the song a chorus) is a very good bet. Find the core melody of the song, the thing everything is hung up on, the last note of that core melody is the ground note of the scale. This is a really safe bet.
There are, of course, exceptions, and then I think you'll need to do some mathematical analysis to find out which key the notes in the melody match the best to. I'm not 100% sure how this is defined but I'm sure people have researched it.
All that said, musicians don't really have this problem. After all, hardly any of this stuff was designed. The only genius piece of engineering in all this was the discovery that if you choose to 12 notes in an octave (and not 8 or 15 or whatever), you have a very versatile instrument that can play almost any melody at any pitch in a way that sounds pretty good to human ears (pretty good, not perfect, because of the all the ≈'s in the "Intervals" section of Eevee's article).
But the rest was discovered, not designed, just by fooling around. The analysis came after the music.
Musicians just start with a scale and then make the music they compose fit. This comes pretty natural to you with a bit of practice; most people have a pretty decent innate ability to hear which melodies "match" with a chord and which chords "match" with a previous chord. In all honesty, once you've understood things this far, I'd recommend fooling around with the easiest instrument or tool you know, rather than diving even deeper in to the mathematics of things :-)
I got your single note melody right here:
Strictly speaking, a "note" cannot define a key. To determine a key, you really need at least 2 intervals, wherein interval a somehow resolves to interval b. Keys are just a mapping of relationships; how does each of the 12 notes relate to each other? If you just play a C major chord, you aren't really playing in the key of CMaj, you're just playing a CMaj chord.
For example: Play B+G, then C+G. This is (arguably) C major. The B note resolves into the C note. That's the 7th moving into the Tonic (#1). This is an example of a V-I resolution, the strongest possible. If you'd like more examples, look up "cadences". There are 'principles' for determining the key, but they should not be understood as proofs.
I think you're also asking if/how to change keys. This is not only possible, but often highly encouraged. There are two extremely common key changes in pop music: 1) Up one step: This is incredibly common and can be heard in "I Will Always Love You" (album version, right after the 3 minute mark when she starts singing the chorus again). Once you start hearing this, you can't stop. It's all over the place. If we're in the key of C, we'll just play a D chord with a lot of confidence, typically after a G chord. 2) Minor to Major (or reverse, moving from sine to cosine in the analogy): This is much more subtle than the previous example. Typically you'll recognize this as a change in 'mood' or 'feeling'. You'll find a lot of Am-Em changes, then the chorus will be a lot of C-G changes. The tonic changes from Am to C, even though all the chords and notes being used are still the same (although the duration of said chords will probably be different).
Most "classical" music moves around keys pretty frequently, in extreme cases multiple times within a measure. And then there are chords/sections in which the key is debatable if not indiscernible (I would argue that the intro to Smashing Pumpkins "1979" is changing keys every 2 measures, but I think there's also a strong argument for it being in a single key)
Thinking about keys in terms of phases is a good basic explanation, but ultimately phase is much easier to measure. Perhaps I see it this way because my understanding of music is much better than my understanding of physics.
I've been composing pop music for a long time without knowing stuff like this.
B+G followed by C+G is most likely going to sound like a cadence in C Major. You could claim it is G major only if you considered it unresolved transition to the subdominant.
No it isn't. If you put any piece of music that is harmonious through a device that analyses the frequencies you'll find three main notes and those give you the key. In C-major for example the main notes are C, E and G. The section will be in C even if the first note is E for example.
You can do this with software. There's a nice video of this here https://youtu.be/xVmkIznjUPE?t=24s
or you can upload a recording to get the chords https://chordify.net/
You can indeed fourier transform the music. I imagine the above software does so.
FTR the pronoun where gender is ambiguous is 'they' (It's also sometimes explicitly requested by nonbinary people).
> she/they/he
I have a similar relationship with pronouns. My own perception of my gender jumps around so much that I don't even bother trying to figure it out. It usually leans in one direction, but I don't have many strong feelings about it.
The difference is phase. Basically, scales aren't just an ordered set of notes, they also have a starting point. This note, the note the scale is named after, is often the last note of a tune played in that scale, and often the first too (especially for more poppy tunes). So if you play Für Elise in C major, like Eevee suggests, the entire melody will be pitched 3 semitones higher than playing Für Elise in A major. And it'll sound awkward because you're supposed to play it on a minor scale.
Once you understand this, the whole notation thing makes a lot more sense as well.