Born in a rapidly changing St. Petersburg, which was called Petrograd from 1914 to 1924, Ustvolskaya was part of the earliest generation of Russians to come of age after the 1917 revolution. Neither of her parents were musically inclined: Her father was a lawyer and her mother was a schoolteacher. But the precociously gifted Ustvolskaya began studying music at seven before attending a music-oriented secondary school (in what was by then called Leningrad) to study piano. She stayed there, enrolling in the city’s conservatory in 1937, at a particularly tumultuous time in Soviet musical history.

It was just a year after the state newspaper Pravda had published an anonymous denunciation of Shostakovich’s opera “Lady Macbeth of the Mtsensk District,” in which the composer was cautioned that his “formalist” musical tendencies — a style that emphasized form and technique over expressiveness and clarity — could “end very badly.” Musicians of the time had reason to heed such warnings: At the end of the 1930s, members of the Soviet intelligentsia were disappearing in the middle of the night before being sent to labor camps or summarily executed.

As an alternative to formalism, Soviet musical bureaucrats championed socialist realism: a style of art that would be intelligible to everyday people and promote national values. Shostakovich took up the call in his “Song of the Forests” from 1949, an oratorio that glorified Soviet forestation campaigns in Siberia through pleasing, triumphant harmonies and an easy-to-understand text setting.

Studying under Shostakovich in the late 1930s and 1940s, Ustvolskaya, too, dabbled in socialist realism. Early works like her Concerto for Piano, Orchestra and Timpani (1946) drew on idioms from both socialist realist and modernist styles, with influences including Stravinsky and Bartok. Combining the aggressive with the lyrical, the piece foreshadows the jagged contours and percussive explosiveness that would define her later works.

Although she was mentioned in further attacks against formalism in 1948, Ustvolskaya was able to counter the accusations by composing a series of state-supported pieces, like music for films. She disavowed most of these works later in life — save for her score to a short comedy film, “The Girl and the Crocodile,” from 1956 — as her mature style emerged.