There’s a documentary playing tomorrow night at Harlem Stage, “Mary Lou Williams: The Lady Who Swings the Band,” which, if it doesn’t advance the form of documentary filmmaking, nonetheless delivers memorable and valuable insights into the life and work of a hidden hero of musical modernity. Its director, Carol Bash, happily departs from the lockstep of chronology to emphasize Mary Lou Williams’s latter-day musical achievements, introducing the mature musician in 1980, the year before her death, at the age of seventy-one, performing splendidly for a university audience, before sketching the launch of Williams’s musical career while still a teen-ager in the nineteen-twenties.

The life that Bash outlines, in a mere hour and ten minutes, is exactly what Williams herself knew it to be—a personal history of jazz. The director cites Williams’s proud but apt assertion of her own place in the musical life of her time—“I’m the only living musician that was there when each era started”—and includes some snippets of performance that display the grand artistic import of Williams’s assertion. As the movie makes clear, she was more than just there—she was one of the key developers of the musical ideas of these eras, and she did more than just remain up-to-date; from era to era, she surpassed herself.

The point is one of a stark historical clarity: the rarity of stylistic change over the course of a jazz musician’s career. Louis Armstrong, for instance, the seminal soloist of the art form, more or less ended his musical development while still in his twenties, and held to the same style from the time of his heroic recordings made between 1925 and 1930 through to the end of his life, in 1971. Duke Ellington, a peerless composer as well as a great pianist, reached a stylistic apogee in the early nineteen-forties and revealed little trace of new trends over the next thirty years. Among the greats, there’s only Coleman Hawkins, who played with Fletcher Henderson in the nineteen-twenties, with Thelonious Monk and Miles Davis in the nineteen-forties, with John Coltrane in the nineteen-fifties, and with Sonny Rollins in the nineteen-sixties; there’s Davis himself, who was in a state of perpetual revolution from the mid-forties through the mid-seventies; and Coltrane went further in a mere decade, from the mid-fifties through his death, in 1967, than any jazz musician ever had.

But Williams, in continuing to outdo herself, also outdid these heroes of her time in several crucial respects: she played better in her sixties than she ever did, reaching an artistic fulfillment in the nineteen-seventies that was due to the triple coincidence of external circumstances of the music world, those of her personal life, and those of her own creative evolution. Williams didn’t just change, she grew; the brilliant ideas that were present in her earlier work expanded on contact with new musical realms, and she found herself doubling back on prior resistance to the strongest and most difficult new styles to incorporate both their freedom and their complexity into her playing.

If Louis Armstrong had stopped performing after 1930, or Duke Ellington had stopped performing after 1942, their places atop jazz history would be no less secure. But Mary Lou Williams, who created much great music throughout her life, did her most powerful, distinctive, personal, and innovative work in her sixties. In this regard, she’s unique in the history of jazz. In the music that she performed in the last decade of her life, in solos, duets, and trios, her originality and her passion, as well as the depth of her experience, come through in an awe-inspiring, hands-on rush of pent-up and long-gestating creative energy.

As Bash emphasizes, Williams’s musical career rose to the forefront of jazz when she was twenty, due to her association with Andy Kirk’s band. That’s where her first husband, John Williams, played (they married when she was in her teens). She greatly impressed Kirk musically, but Kirk didn’t like the idea of having a woman in the band; she was relegated to the role of a replacement pianist, but happened to be called upon to play when the band auditioned for the record-company executive Jack Kapp. The story that Bash tells of her change in fortunes is horrific: the band reached Chicago to record for Kapp, but Williams was left behind; Kapp insisted that the band couldn’t record without her; Kirk sent for her. In the train from Kansas City to St. Louis en route to Chicago, she was raped by the conductor. She then arrived in Chicago and went straight from the train to the recording session, where, upon arrival in the studio, Kapp tapped her to play solo, and she unleashed a torrent of musical invention, “Nite Life.” Interviewed by Bash on-camera, the historian Farah Jasmine Griffin says of that exuberant performance that “we don’t hear it thinking of trauma” and adds, “Music, for Mary Lou, is really a documentation of the triumph over the trauma.”

Of trauma, there was plenty—those that were due to being a woman; those that were due to being black; and those that arose from the life of a musician, of an artist. Born in Atlanta, Williams moved to Pittsburgh as a child, and her family traded the legal terror regime of Jim Crow for the unchallenged practical discrimination of the North. But Williams’s teachers recognized her musical genius and helped to foster it. Her home life, and especially her relationship with her mother, were troubled, and she joined a travelling band both to make money and to get away.

Bash deftly outlines the effort that it took for her to escape from the “clowning” of show business and take her music seriously, and aptly highlights the cauldron of Williams’s musical innovation—the band’s residence in Kansas City. They had few commercial prospects, but the city was a thriving musical hub, and Williams played constantly alongside the greats of the time, including Hawkins, Lester Young, and Count Basie, and in the presence of the adolescent Charlie Parker, with whom she’d play in New York twenty years later.

“Mary Lou Williams: The Lady Who Swings the Band” gets its subtitle from a composition by Sammy Cahn and Saul Chaplin, in honor of Williams, that the Kirk band recorded in 1936. Her association with that band ended in 1942, though, because she found its popular styles musically limiting. Bash details Williams’s move to New York, her prominence at Café Society, her passionate devotion to musical innovation and to the innovators themselves—and the trouble she faced due to her musical seriousness, her gender, and her dark skin (light-skinned black artists found a much easier time of gaining acceptance).

The movie’s prime virtue is its panoply of voices, including interviews with the musicians Hank Jones, Billy Taylor, Carmen Lundy, and Geri Allen (who is also filmed giving a splendid performance of Williams’s composition “Lonely Moments”); the historians Gary Giddins, Griffin, and Tammy Kernodle, and her friends Johnnie Garry and Gray Weingarten. There’s also a generous offering of clips of Williams in performance, both on record and on film, and Bash also includes citations from Williams, spoken on the soundtrack by Alfre Woodard (often accompanied by an unfortunate skein of boilerplate stock footage; it would have been better simply to see Woodard at a microphone).