Nijinsky, the famous dancer who played the original Petroushka in 1911
Stravinsky's first ballet, "Firebird," was inspired by traditional Russian fairy tales. It's possible that he would have drawn from another fairy tale for his next ballet, but as he was stretching his music in more modern ways, he could have been even subconsciously influenced by Andersen's 1838 fairy tale, which which was also a less traditional story. He was also in the middle of composing a piece based on the Andersen fairy tale, "The Nightingale."
"Steadfast Tin Soldier" features three main characters; a toy tin soldier, the ballerina he is in love with, and the jack-in-the-box that is his rival.
"Petroushka" features another toy, this time a puppet, who is also in love with a ballerina, and the puppet Moor who is his rival.
Tuscon production of "Petroushka"
The Tin Soldier embarks on a journey when he falls out of the window, which ends up with him back in the same nursery room, by chance. Petroushka breaks out of his cell to rescue the ballerina from the Moor's seduction, but she does not want to be rescued-the Moor chases Petroushka outside and he finds himself back at the Shrovetide Fair where we first met him performing.
Set for the Shrovetide Fair, by Benois
1911 "Petroushka" souvenir program
Both stories are also characterized by the helplessness of the main characters, and their unfortunate ends. Neither of them can gain the love of the ballerina they desire, and in the end they both die. The Tin Soldier was inexplicably thrown into the fire by the boy who owned him, and the Moor killed Petroushka in front of the Shrovetide Fair crowd. The charlatan (who owns the puppets) showed the crowd that he was just a lifeless puppet, but after the crowd leaves, Petroushka's ghost is seen shaking his fist at the Charlatan, but then collapses on top of the puppet both, "his arms swinging to and fro in the night."
Final scene in "Steadfast Tin Soldier," Marcia Brown
Stravinsky wrote in his autobiography that "in composing the music, I had in my mind a distinct picture of a puppet, suddenly endowed with life, exasperating the patience of the orchestra with diabolical cascades of arpeggios. The orchestra in turn retaliates with menacing trumpet blasts. The outcome is a terrific noise which reaches its climax and ends in the sorrowful and querulous collapse of the poor puppet." From there, the ballet was further developed by Diaghilev, creator of the Ballet Russes and commisioner of Stravinsky's ballets, and Alexandre Benois, the production designer. Given that Andersen's fairy tales had become famous world wide by the dawn of the 20th century, it's likely that at least one of the men who worked on the ballet would be familiar with the earlier fairy tale. Again, it could have been subconcsious influence, or it could have been coincidence-but the similarities are quite striking.
Design for street dancer by Benois