In spirit, this seems similar to: Do the notes in a scale have to be played in order?.
For instance, if you're playing C major, and instead of playing C D E F G A B, you play C D E F G A, or C D E F G, would that still be considered playing in that scale or key?
If the home note was C, it would be considered playing in the key of C major. (People don't really talk about 'playing in' a scale, in Western music theory at least).
Because I doubt that most music literally just repeats the exact notes found in a certain scale over and over again to create a melody, otherwise most music would sound the same, right?
Of course - you're right.
Analogies are never perfect, but let's try one - the English alphabet.
If someone asks you to write the English alphabet, you should write ABCDEFGHIJKLMNOPQRSTUVWXYZ. That's the alphabet. You shouldn't write RSVFGOPQWXYZHIJNKLMABCDETU, because that's not the study form of the alphabet.
If someone tells you to write some words that use the English alphabet, you can write the letters in orders that convey the meaning you want. "CAT", "DOG", "PANGOLIN".
and if someone tells you to write in English, you will mostly be using letters from English, but you might use some letters that are not in the English alphabet: "Send me your résumé".
'é' Is not a letter from the English alphabet, but that sentence is still English.
Similarly, in music,
- if someone tells you to "play the C major scale", you should play CDEFGABC.
- if someone tells you to play a sequence of notes or melody using the C major scale, you can use the notes in whatever order you like
- if someone tells you to play in the key of C major, then you will mostly play notes from the C major scale, in whatever order you like, and you might even play some other notes outside C major - as long as your "home note" or tonic for the piece is C.
It seems like when someone comments a scale or key that a song is in, the notes usually aren't perfectly arranged in the way that you'd expect that scale to be in. Like, there will be other notes interspersed in that aren't part of that scale, but it is still considered in that scale or key.
Well, playing notes outside of the scale is a different thing to playing the notes in the scale, but not in order.
But again, yes, you're right. When we talk about Playing in a key, that's a general, overall, description of the piece's tonality, but often notes outside of the scale associated with the key are used. That's the main reason we have accidentals.
Also, what if multiple instruments are playing simultaneously? Would you judge the melody's scale by each instrument, i.e. the guitar is in C, the bass is in Gb, etc., or do you judge it by the simultaneous notes just as they appear? Because that seems like it would be incredibly confusing and hard to analyse, and I don't think you'd be able to really judge its scales unless the instruments were playing similar notes or something.
From a beginner point of view, you should probably assume that all instruments will be playing in the same key, and mostly playing notes from the scale associated with that key, as in real music that is usually what you will find. If you really find more than one scale in use in a piece, it may be polytonal and impossible to describe using one key.