Where did you come from?
What is the nuance of this emphasis? I could understand it if the emphasis were on where.
Where did you come from?
What is the nuance of this emphasis? I could understand it if the emphasis were on where.
Here is a hypothetical conversation where emphasis on did might make sense:
Speaker A: "You look sweaty. Were you working out at the gym?"
Speaker B: "No, I didn't come from the gym."
Speaker A: "Well, where did you come from?"
Speaker A wants to elicit an affirmative statement by that emphasis. The emphasis also expresses annoyance at Speaker B's uninformative negated response.
@Jasper suggests that the emphasis indicates surprise at your sudden appearance; but in my experience that would be indicated by stressing the you ("Where did you come from?").
When the did is stressed, especially if said in an arch voice (or textually in a sarcastic context), it would imply that your behavior is weird, incomprehensible, or just odd.
In that situation, you could extend the sentence by naming a foreign or alien place:
Where did you come from? Mars?
In this case, it is not the location he came from that is important. It is the very act of appearing from somewhere, and that act is represented by the verb did.
Some emphasis variations:
"Where did you come from?"
"Where did you come from?"
"Where did you come from?"
"Where did you come from?"
"Where did you come from?"
All of these, except for emphasis on "you" are inquiries about where you came from. They vary a bit on the extra information conveyed along with the query. The emphasis on "you" is really more an expression of shock, and perhaps asking "How did you get here without my noticing earlier?"
In most contexts, putting the stress on did in OP's construction effectively uses that word as a "proxy" for stressing the word where - which would normally imply the speaker is genuinely and intensely interested in knowing where the other person came from. But...
Unless delivered in some (contrived) context where there's no obvious entrance through which the other person could have (just) appeared, it's far more likely to be a rhetorical question. That's not to imply the asker already knows the answer - he probably neither knows nor cares. He's just obliquely referencing wherever you came from scornfully. Probably implying something like....
"They don't teach very good manners wherever you came from"
...or some other snide put-down of your place of origin (effectively, of you).
Since it hasn't been mentioned yet, the meaning of the emphasis can be determined by the part of speech being emphasized.
"Did" is a verb. When a verb is emphasized in a question like this, it's pointing out the action in opposition to some other action(s) that were not done.
"Did/Do" is a special case - it's the meta-verb, verbs are about "doing" things. The only alternative to "doing" is "not doing".
So:
For other parts of speech, (Where, you, come, from) the emphasis plays out differently.
Most of this has been implied in other answers, but it's useful to explicitly recognize the parts of speech and how they play into it.
I would interpret it as meaning that "did" is to be emphasized when the line is spoken -- "Where DID you come from?" (By "emphasized" I mean spoken a bit slower, louder, and more distinctly.) When spoken, emphasis on "did" in that situation implies that it's a rhetorical question, though I can't give you a general rule as to when/how that works.
But, eg, "What HAVE you done?" would be a similar rhetorical question -- the speaker knows perfectly well what you did, but does not approve of it.
FWIW: "Where did you come from?" would be appropriate if one previously asked the other party for, say, country of origin, and the response did not include that information. It's reiterating the request.