janáček wrote this opera between 1903 and 1905. his daughter olga had died shortly before he began to compose it. he had also just finished his opera "jenůfa" which has a tragic ending for the young girl in the story.