Composition
Shostakovich received the completed script for King Lear in December 1968, along with a long letter from Kozintsev that explained what kind of music he wanted, particularly for the Fool. The director asked him to compose not background music for scenes, but motifs for characters and particular situations, as well as for more abstract themes. "It's hard for me to say how best to compose, not some long music piece, but these separate elements that make up the very fabric of the action", he wrote.
Filming for King Lear began on January 19, 1969. Three days before, on January 16, Shostakovich gave permission to Kozintsev to reuse his songs for the Fool from their 1941 King Lear collaboration. On June 29, the composer submitted his first piece of original music for the film, in response to a request from the director for "a few very simple melodies" to be sung a capella by Edgar in disguise as Poor Tom. Leonhard Merzin, who played Edgar, sang the songs for Kozintsev, who was pleased, but could not find an appropriate place for them within the film. He suggested to Shostakovich the possibility of using them non-diegetically at the beginning of the film in a "barely audible sad voice". The songs were recorded for the soundtrack in July, before the shooting of the opening scene itself, and without the supervision of the composer. Only one song, "Still through the hawthorn blows the cold wind", was used in the film. Isaak Glikman later pointed out the song's similarity to "Le Suicidé" from Shostakovich's Fourteenth Symphony, which the composer acknowledged.
Subsequently, Kozintsev asked Shostakovich for a "call sign" depicting the Fool's bells; a musical cue which would indicate to the viewer that "the broadcast is about to begin and that he must tune in on the exact wave". Shostakovich responded with a brief piece for percussion. Upon hearing it, Kozintsev felt that it did not fit in with the film, although he said it was an excellent piece of music. "The result was not a sign for recognition", he wrote, "but a musical characterization". Displeasure over cut music notwithstanding, Shostakovich agreed to all of Kozintsev's decisions out of professionalism and conviction in the requisite synthesis of the arts needed to create a unified cinematic statement.
Shostakovich initially struggled with composing music for King Lear. He shifted his energies for a time into his Thirteenth String Quartet, which he had begun in August. From November until December 24, he was hospitalized and unable to compose. On December 18, Kozintsev, who had just returned to Leningrad from filming in the Estonian SSR, informed the composer that shooting was mostly complete and projected to end in May 1970. His letter explained in detail the kind of music he expected for King Lear. The director said there would be little action directly represented by music. He did not want "stylization of antiquity" as in Hamlet, but "the language of contemporary art which you use to express the contemporary world". He also requested a salon music–style piece to accompany a scene with Goneril and a cue for chorus a capella that would express "grief, human suffering which has no limits" and a "lament of the earth itself". Shostakovich replied on December 24 that he had just been released from the hospital after a 40-day stay, was ready to work with the director on a final musical outline for the film, and that he would complete the score in 1970 at his dacha in Repino.
The two met at the Lenfilm studios in Leningrad on January 15, 1970, where Shostakovich viewed preliminary footage of the film and praised the results. After arriving at his dacha in Repino, he initiated work on the score, but further progress was delayed again. The composer went to receive treatment for his weakened limbs at the clinic of Gavriil Ilizarov in Kurgan. From there, Shostakovich reported on February 27 that he would not be able to continue work until April and suggested that he be replaced. Kozintsev replied by assuring him that the schedule and production would accommodate his needs. To this, Shostakovich reiterated that poor health was detaining his ability to complete the score. "Again I suggest you think about replacing me", he told the director. Krzysztof Meyer recalled that the composer told him during this period that he was physically unable to complete the music. On May 1, Kozintsev informed Shostakovich that he could no longer postpone production. He suggested omitting all cues requiring a symphony orchestra and reducing the use of music to the minimum extent the film could permit. However, he said that finding a replacement composer was no longer possible.
It was in early May that Shostakovich began intensive work on the King Lear score, parts of which he composed concurrently with Loyalty and the Thirteenth String Quartet during his medical treatment in Kurgan. On May 13, he sent along a number of cues to Kozintsev, but warned the director that he would not be able to leave Ilizarov's clinic in order to attend recording sessions for the soundtrack on May 22. The composer was released from the clinic on June 11; on June 18, he arrived in Repino, where he continued work on the film score. That same day, he visited Lenfilm to see more footage and attend the soundtrack's recording sessions with the Leningrad Philharmonic Orchestra conducted by Dzhemal-Eddin Dalgat. From this point until the completion of the score, Shostakovich and Kozintsev worked closely together, meeting regularly in person and over the telephone. The composer submitted music for symphony orchestra, including for the storm scene, which he was eager to score, in spite of the director's suggestion not to. The final cue Shostakovich composed for the film was the choral "Lamentation", which profoundly impressed Kozintsev:
Shostakovich expressed pity like a force. There is such an abundance of feeling contained in the grief of his "lament" that it gives rise to faith: the evil times will pass, they cannot do otherwise if such a voice is heard.
All work on the score was completed on July 27, 1970. In an interview with Izvestia, Shostakovich remarked that the process of composing the score for King Lear had been a "long and laborious effort". It was the final completed collaboration between Kozintsev and Shostakovich.