Emanuel Johann Schikaneder, the author of the libretto of _Die Zauberflöte_ (The Magic Flute), was a wandering theater director, poet, composer, and play actor. Vain, improvident, shrewd, a bore, he nevertheless had good qualities that won for him the friendship of Mozart. In 1791 Schikaneder was the director of the Auf der Wieden, a little theater where comic operas were performed. He no doubt would have made a success of his venture, had he curbed his ambition. On the verge of failure, he made a fairy drama out of _Lulu, or the Enchanted Flute_, Liebeskind's story in a collection of fairy tales published by Wieland. He asked Mozart to write the music for it. Mozart, pleased with the scenario, accepted the offer and said: "If I do not bring you out of your trouble, and if the work is not successful, you must not blame me; for I have never written magic music." Schikaneder had followed closely Wieland's text; but he learned that Marinelli, a rival manager, the director of the Leopoldstadt Theater, thought of putting upon the stage a piece with the same subject; so he hurriedly, and with the assistance of an actor named Gieseke, modified the plot, and substituted for the evil genius of the play the high priest Sarastro, who appears to be the custodian of the secrets and the executor of the wishes of the Masonic order.
Schikaneder knew the ease with which Mozart wrote. He also knew that it was necessary to keep watch over him, that he might be ready at the appointed time. Mozart's wife was then in Baden. Schikaneder therefore put Mozart in a little pavilion which was in the midst of a garden near his theater. The music of _The Magic Flute_ was written in this pavilion and in a room of the casino of Josephdorf. Mozart was deep in doleful dumps when he began his task, so Schikaneder surrounded him with members of his company. It was long believed that the composer was then inspired by the beautiful eyes of the singing woman, Gerl, but the story may rest on no better foundation than the one of the Mme Hofdaemmel tragedy, which even Otto Jahn thought worthy of his investigation.
Schikaneder made his proposal early in March, 1791. The overture, with the Priests' March, was composed September 28, 1791. On September 30 of that year _Die Zauberflöte_, a grand opera in two acts, was produced at the Auf der Wieden Theater.