Kenneth MacMillan's Mayerling – like many of this brilliant choreographer's greatest works – depicts a mind driven beyond despair. For this 1978 Royal Ballet commission MacMillan and his dramaturg Gillian Freeman turned to a historical event: the Mayerling Incident, a tragedy and scandal of the late 19th-century Austro-Hungarian imperial family that shocked a continent.

The events one night in Mayerling, a Viennese hunting lodge belonging to the Empire's Crown Prince Rudolf, have been variously romanticized, scrutinized and mythologized; but in its simplest form the story is of a group of people at once instruments and victims of the rot eating at the heart of imperial Europe.

Early on 30 January 1889 the bodies of the 30-year-old Crown Prince Rudolf and his 17-year-old mistress Baroness Mary Vetsera were discovered in his bed at Mayerling, with his gun beside them. Mary's uncles were urgently summoned; her corpse was dressed and her hair arranged over the bullet hole; propped upright by a broomstick, her body was escorted by carriage to a nearby graveyard and secretly interred. Rudolf's death was announced, first declared as a heart attack, then as an accident. At last his father, the Emperor Franz Joseph, officially acknowledged his son's suicide but not Mary's death, then opened an inquest only to close it abruptly and charge his Prime Minister with burying the investigation. For the rest of his life Franz Joseph maintained a rigorous silence, breaking it only to declare, 'The truth is far worse than all versions'.

That truth can never be fully known, but with the gradual release of letters and documents, and even some self-exonerating memoirs, a tapestry of facts begins to emerge. Rudolf's series of suicide notes suggest that some of the wildest conspiracy theories are wide of the mark. The notes themselves specify no further reason for the murder and suicide than that Rudolf's honour demanded it. Various rationales have been proposed: that Rudolf was heavily in debt, that he feared pressure from the Hungarian nationalists with whom he had become involved, that he feared the venereal disease that afflicted him, or the madness rife in his mother's family.

All no doubt played a part. But for much of his life Rudolf seems to have had an obsession with death, writing that 'the opportunity of watching someone die and hearing him breathe his last… is always a remarkable spectacle for me'. He seems to have needed a companion in death, and had begun his search months before the Incident. In December 1888 he asked his demi-monde mistress Mitzi Kaspar to commit suicide with him; she alerted the police chief, who apparently simply filed the report away. In the end it would be Rudolf's cousin and old flame Baroness Marie Larisch who played the gruesome role of procuress.

Marie fostered a relationship between Rudolf and the impressionable Mary Vetsera, who had been entrusted to Marie's care by her mother (herself allegedly another former mistress of Rudolf's). In her memoirs Marie claims she was trapped between the aggressive demands of the volatile Crown Prince and her duty to Mary's mother, who relied upon her daughter's success at court to boost the family's ailing finances. She further hints at a possible coup-d'état headed by Rudolf and a sinister conspiracy to suppress it. Whatever her reasons, letters from the time track a chilling story: Marie Larisch encouraging Rudolf in his suicide-wish, calming Mary's fears, even delivering the young woman to Mayerling on the night of her death.

Ultimately this was a time rife with corruption, endemic hypocrisy and grotesque decadence, from which no one player in the Mayerling drama comes through unsullied. It's difficult not to conclude that the whole era was at fault.

Nearly 90 years after the original incident, MacMillan and Freeman scoured letters, diaries, official reports both ostentatiously proclaimed and suppressed. What emerges is a series of portraits of uniquely compelling intensity. The result is MacMillan's masterpiece.

Franz Liszt (1811–86) died less than three years before the horrible double suicide of Crown Prince Rudolf and Mary Vetsera at Mayerling in January 1889, and almost a hundred years before his music was used for Kenneth MacMillan’s ballet based on Rudolf’s life. Like the Crown Prince, Liszt had suffered from depression in his precocious teens. His mother claimed that Liszt was cured by the booming cannons of Paris’s 1830 July Revolution.

Liszt went on to a distinguished career as a virtuoso concert pianist and a pioneering conductor. His gloomy romantic temperament, which found an outlet in the religious devotion of his later years, was offset by the serenity and sweetness of his compositions.

However, this gentle outlook is hardly an ideal match for the decadent, neurotic world of Mayerling, which was orchestrated from Liszt’s music by composer and conductor John Lanchbery in the 1970s. There’s no place in the ballet for the great melodies of Liszt’s two best-loved piano pieces, the Liebestraum no.3 and the 'Sonetto del Petrarca no.104' from Années de pèlerinage.

Instead, Lanchbery’s musical choices for Mayerling tend to relate to Liszt’s more complex works. He turned to the symphonic poems Tasso: lamento e trionfo, Mazeppa, Festklänge and Héroïde funèbre, in which Liszt developed a more radical harmonic language. And for the first scene of Act II, when police raid the tavern in which Rudolf is carousing with his Hungarian friends and mistress Mitzi, Lanchbery used Liszt’s dramatic and sensual Mephisto Waltz no.1.

Liszt always liked to stress his Hungarian roots and he absorbed influences from this heritage into his music. Lanchbery drew on several of the Historical Hungarian Portraits to provide local colour in Mayerling, and orchestrated TroisMorceaux en style de danse ancien hongrois for the scene in which nationalist Hungarian officers plead their cause with Rudolf.

Lanchbery’s most important debt is to the sombre colouring of Liszt’s quirkiest - and possibly his greatest - orchestral work, A Faust Symphony (1854–7). The opening movement of this piece – a musical portrait of the character Faust – provides the funereal prelude of the ballet as well as the leitmotif of the pistol, which is fired once in the first- and second-act finales and twice in the ballet’s climactic, final scene.

For Mayerling’s fraught music of love and desire, Lanchbery used his own atmospheric arrangements of several of the Transcendental Études. Among these 12 masterpieces, which Liszt assembled in 1851, the last ('Chasse neige') provides material for the disturbing bedroom scene in Act I where Rudolf threatens his hapless bride Princess Stephanie with a revolver, before violently making love to her. The third ('Paysage') combines with the Faust music for the parallel scene in Act II between the prince and his new 17-year-old mistress. And the grand, complex 11th étude ('Harmonies du soir') sounds the note of death at the end of Act III.