"Amandla! A Revolution in Four-Part Harmony," Lee Hirsch's bristling elegy to the musicians who fought against South African apartheid, is a film that could have gone wrong in so many ways. It could have risen no higher than the platitudes of a Terry Gross interview with an aging jazz artist, about the struggle, the passion, the indomitable human spirit. It could have been merely uplifting, a long crescendo from the darkness of oppression to the joy of liberation. It could have committed the usual sin of so many movies about artists: Using their words like a soundtrack, not to clarify art, but to coo about how meaningful it all is.

Instead we get a film that captures musicians explaining how they might adapt a particular lyric by removing the word "Bible" and inserting "AK-47." Music is taken seriously, not just as balm for the soul, but as a series of strategies: for confrontation, for instilling fear, for remembering the dead, for communicating a sub rosa sense of identity during a time of cultural decimation.

The history of South African music is traced parallel to the history of apartheid, from the songs of the martyred activist and composer Vuyisile Mini (executed by the government in 1964) to the emergence, in the later years of the regime, of the toyi-toyi, a dance and song style that seethes with a newly insistent revolutionary bravado.

Music as entertainment is a luxury, an escape, an idle dalliance with a limited range of human emotion, mostly shades of nostalgia. Music, in "Amandla!," is a necessity, a communal possession and a practical weapon. Occasionally, bad politics creates good music, if musicians who possess both talent and courage rise to the challenge. Western art music has been pathetic on this front, a little outrage to the atrocities of World War I (Stravinsky) and furtive resistance to the oppression of Stalin (Shostakovich) notwithstanding.

The musicians interviewed in "Amandla!," by contrast, often bear hyphenated titles -- musician-activist is a common one -- and they don't waste time discussing music as a career or a calling. For them, it was clearly a summons.

Speaking for the camera, and sometimes performing, are artists whose lives spanned the history of apartheid, including Hugh Masekela (who spent much of his life in exile in the United States), Abdullah Ibrahim (the immensely articulate jazz composer and pianist) and Miriam Makeba (whose accomplishments, in exile, included singing at John F. Kennedy's 1962 birthday celebration at Madison Square Garden). Vusi Mahlasela, born in the 1960s, comes from a younger generation; his singing, in a brilliant, high, clear tenor, is some of the most affecting.

But one moment stands out, not just for its musical power, but for what it says about the intimacy Hirsch developed with his subjects. Sophie Mgcina, a musician and actress, is filmed in her back yard chatting with an old friend, the actress Dolly Rathebe. Unprompted, Mgcina sings a simple a cappella song called "Madam Please," in which a maid confronts her employer, and contrasts their two lives. The irritations and inconveniences of a wealthy white woman's life are juxtaposed with the abject suffering of a domestic servant. The melodic line is as finely balanced as the moral scales in which two existences are judged. It's a stunning musical moment, and after it's over, the camera captures the two women, marooned in silence. Such silences, which recur after other spontaneous performances captured in the film, are haunting. This is music that isn't possessed by anyone, which exists beyond any performance or performer; it comes out of some void.

Interviews and music are mixed with historic footage, capturing the full evil trajectory of apartheid. Black neighborhoods are destroyed, replaced by ghastly tracts of ghetto housing. Packed trains transport workers into communities they serve almost as slaves. Police in fascist get-up beat, harass and kill. Boys throw stones at tanks. Had the men and women who resisted apartheid lost the struggle, they'd be labeled terrorists; having won, their oppressors seem unaccountably foolish and absurd.

Hirsch's story ends with the election of Nelson Mandela. The struggle for black freedom in South Africa, now a struggle for economic equity, continues, as does the music that both inspires it and is inspired by it. The angry new South African hip-hop is not a part of this film, which ends both happy and a bit hollow. But it also ends safely free of a cliche that might easily have marred a lesser documentary: the equation of music with healing. Viewers will leave "Amandla!" moved by the music, impressed by the musicians and dubious about the possibility of political and social healing.

The human imagination has produced few societies so macabre to the core as apartheid South Africa.

Amandla! A Revolution In Four-Part Harmony (103 minutes, at Visions Cinema/Bistro/Lounge) is rated PG-13 and contains images of violence and minor obscenity.

Pianist Abdullah Ibrahim is one of the South African musicians whose lives spanned the history of apartheid featured in "Amandla! A Revolution in Four-Part Harmony."