Although the overall mood of Twelfth Night is joyful, it changes slightly depending on which characters are present in a scene and where the scene takes place. Scenes taking place at Orsino's court, which are often set to music, are usually whimsical and romantic. The conversations between Orsino and Viola that occur here can be comedic at times, but they are generally quite earnest. The mood is similar during conversations between Sebastian and Antonio, as the audience is keenly aware of the loyalty and affection that the characters have for one another.
Scenes taking place in Olivia's household, by contrast, involve more over-the-top comedy. When Maria, Sir Toby Belch, and Sir Andrew Aguecheek are on stage, their dialogue is predominantly raunchy and filled with puns and double-entendres. More instances of physical comedy occur here as well, which contributes to the cheeky, rollicking mood.
There are some moments where the play's overall fanciful and silly mood turns sour. While the prank that Maria plays on Malvolio is initially quite funny, the treatment to which he is subjected drags on for much longer than necessary and seems peculiarly mean-spirited. Even though Malvolio is not a particularly likable character, the audience cannot help but wonder whether he truly deserves such cruelty.
There is also a moment in Act 5, Scene 1 where Sir Toby is uncharacteristically vicious to Sir Andrew:
Andrew: I’ll help you, Sir Toby, because we’ll be
Toby: Will you help?—an ass-head, and a coxcomb,
and a knave, a thin-faced knave, a gull?
Up until this point, even though the audience knows that Toby has a pretty low opinion of his fellow lord, Andrew has regarded him as a dear friend. But without any real provocation, Toby chooses this moment to make his attitude abundantly clear.
Finally, the mood of Feste's ending song is decidedly somber:
Feste: But when I came, alas, to wive,
With hey, ho, the wind and the rain,
By swaggering could I never thrive,
For the rain it raineth every day.
Most, though not all, of the characters have achieved their happy ending, but these lyrics force the audience to wonder about what comes next. Viola and Orsino seem happy now, but will they be able to weather the hardships of marriage and old age?