H.M.S. Pinafore

H.M.S. Pinafore, or The Lass That Loved a Sailor is a two-act operetta by Gilbert and Sullivan. It is the fourth of their fourteen operettas. It premiered on 25 May 1878 at the Opera Comique in London, England. It had 571 performances. The operetta became an international success, and had great influence on the development of musical theatre in Britain and America.
Story.
Act I.
The H.M.S. "Pinafore" lies at anchor off Portsmouth. Little Buttercup comes on board to sell things to the sailors. She says that she has a secret. Ralph Rackstraw says he loves Josephine. The Captain worries that his daughter will decline Sir Joseph's marriage proposal. She tells her father that she loves a sailor in his crew, but assures him that she will never reveal her love to him.
Sir Joseph comes on board with his sisters, cousins, and aunts. He says he rose from humble beginnings to be "the ruler of the Queen's Navee", although he has no qualifications. He then delivers a lesson in etiquette, telling the Captain that he must always say "if you please" after giving an order for "A British sailor is any man's equal". He has composed a song to illustrate that point. 
Ralph is delighted with Sir Joseph's views on equality. He decides to declare his love to Josephine. Dick Deadeye points out that "when people have to obey other people's orders, equality's out of the question". Ralph is left alone on deck. Josephine enters, and Ralph confesses his love. She rejects his love and leaves. Ralph decides on suicide. He puts a pistol to his head. Josephine returns to say she loves him. They make plans to leave that night to marry. Dick Deadeye warns them against such a scheme. The joyous ship's company ignores him.
Act 2.
Later that night, Captain Corcoran tells Buttercup that he would have returned her love long ago if they were not so far apart in social class. She warns him that a change is in store for him. Sir Joseph complains that Josephine has not yet agreed to marry him. The Captain thinks she is probably dazzled by his "exalted rank". He suggests that Sir Joseph persuade her that "love levels all ranks". If he does so, Josephine will surely accept his proposal. Sir Joseph makes his argument to Josephine, but it only serves to strengthen her determination to marry Ralph. 
Dick Deadeye tells the Captain of the lovers' plans to elope. The Captain confronts Ralph and Josephine as they try to leave the ship. The pair declare their love. The furious Captain swears. Sir Joseph has heard this oath and is shocked. He orders the Captain confined to his cabin. Sir Joseph asks what provoked the Captain's outburst. Ralph replies that it was his declaration of love for Josephine. Sir Joseph is furious. He has Ralph taken to the ship's dungeon. 
Little Buttercup now reveals her secret. Many years ago, she had cared for two babies. One baby was of low birth, but the other was a wellborn babe. She "mixed those children up"  the wellborn babe is Ralph and the Captain is the babe of low condition. Sir Joseph realises that Ralph should have been the Captain, and the Captain should have been Ralph. He calls for both, and they enter wearing one another's uniforms. Sir Joseph's marriage with Josephine is now out of the question. He hands her to Ralph. Corcoran will marry Buttercup. Sir Joseph will marry Hebe. There is general rejoicing.
Impact.
"Pinafore" had great influence on the development of musical theatre. According to theatre historian John Kenrick, "Pinafore" was an international sensation and reshaped the commercial theater in both England and the United States. Historian John Bush Jones writes that "Pinafore" and the other [Gilbert and Sullivan] operas show that musical theatre can provide amusement yet address current issues and events. He writes that "Pinafore" was the first musical to bring together story, song words, and music into a balanced whole. He adds that the show's popularity produced an American audience for musical theatre, and that the show has served as a model of the musical ever since.