Jerry Hannan will perform Oct. 6 after the North American premiere of “The Mad Hannans,” a documentary that explores the complex musical and personal relationship of Jerry and his late brother Sean. (Photo by Nicole Ryan)

Four decades ago, when the Mill Valley Film Festival was still known as the Saturday Night Movie, Mike Bloomfield, the prodigiously talented lead guitarist from the Paul Butterfield Blues Band, would wander unannounced into the Odd Fellows Hall, now the Throckmorton Theatre, sit down at an old upright piano in the corner on movie nights and play just for the fun of it as the audience filed in.

You could say that was the beginning of the festival’s longstanding relationship with Marin’s musical community, one that continues to this day as the festival celebrates its 40th anniversary Oct. 5 to 15. This anniversary year is particularly rich musically, with 10 nights of shows at Mill Valley’s Sweetwater Music Hall.

“To do this many concerts, many of them associated with films, is gratifying,” says festival founder and executive director Mark Fishkin. “It’s like a mini-music festival within the film festival.”

It’s a kind of serendipitous coincidence that one of this year’s documentaries, “Horn from the Heart: The Paul Butterfield Story,” is a look at the complicated life and important career of a tough kid from Chicago who studied at the feet of Little Walter, Howlin’ Wolf and Muddy Waters, becoming a harmonica ace and bandleader, bringing the blues to young, white rock audiences in the 1960s.

After the Oct. 10 screening of “Horn from the Heart” at the Sequoia Theater, Butterfield’s old pal, Nick Gravenites, who wrote “Born in Chicago” and Buried Alive in the Blues” and was a bandmate of Bloomfield’s in the short-lived Electric Flag, heads an all-star blues band in a Butterfield tribute at Sweetwater. (A word to the wise: the live shows are not included in your movie ticket, so be prepared to buy a separate ticket for the Sweetwater concerts.)

Good luck getting a ticket for Marin’s own Huey Lewis and the News, who’ll be playing special 40th anniversary shows at 7 and 9 p.m. Oct. 15. The evening kicks off fundraising for the festival’s recently launched capital campaign to restore Mill Valley’s beloved old Sequoia Theater. Fishkin tells me that the plan is to do the kind of showplace restoration job on the Sequoia that the California Film Institute, the festival parent’s organization, did in its transformation of the Rafael Film Center. Tickets are $90 in advance and go on sale Tuesday at sweetwatermusichall.com. The price rises to $125 on the day of the shows, but that’s academic, since Sweetwater only holds about 300 people and Huey and the boys, who backed up traffic for miles when they played the Marin County Fair, are sure to be an instant sell out.

Another hot ticket — hard rock guitar hero Joe Satriani makes his film festival debut at Sweetwater on Oct. 14 after the world premiere of “Beyond the Supernova,” a documentary by his filmmaker son, Zachariah. In his debut as a director, he chronicles his shredder dad’s 2017 concert tour celebrating the 30th anniversary of his platinum-selling album “Surfing with the Alien.” This show’s $75, $115 for a VIP meet and greet.

I’m particularly keen on checking out Jerry Hannan’s show Oct. 6 after the North American premiere of “The Mad Hannans,” a documentary that explores the complex musical and personal relationship of Marin’s Jerry and Sean Hannan, brothers from a big San Rafael Irish-American family whose musical reunion ended tragically in 2013 with Sean’s death from cancer at age 45.

I wrote one of the first stories about the Mad Hannans when they were just starting out, and have been a fan of Jerry’s ever since. At Sweetwater, he’ll be joined on stage by former Talking Head Jerry Harrison, Cody Dickinson of the North Mississippi Allstars, Shawn Dailey from Hole, Josh Clark from Tea Leaf Green and the film’s musician/director, Martin Shore.

Bandmates from Sly and the Family Stone reunite on the Sweetwater stage after an Oct. 13 screening at the Sequoia of “On the Sly: In Search of the Family Stone,” a documentary about one man’s quest to find the mysterious, reclusive Sly Stone.

On Oct. 12, slide guitar maestro Roy Rogers fronts a band that once backed him and the late Doors keyboardist Ray Manzarek. That show comes after a screening of “Third Mind Blues,” a behind-the-scenes look at the creative partnership between Rogers and Manzarek, the keyboardist’s last musical project before his death in 2013.

The good work Mill Valley’s Sarah Wasserman has done for Haitian children is featured in the Oct. 7 world premiere of “Fingerprints,” a short documentary on kids from Haiti and the U.S. who are brought together by the power of music. It’s followed by “From California to Haiti: Kids Connecting Through the Power of Music,” an all-star concert with some surprise guests.

Also appearing as part of the festival series: Reggae from Jamaica’s Wailing Souls, Oct. 8; singer-songwriter Sarah Jarosz, Oct. 9, and B and the Hive, featuring the soulful singing of Brianna Lee.