Viggo Mortensen was always drawn to the old piano in his grandparents’ house in Watertown, N.Y., 30 miles south of the Canadian border, the community where he lived after his parents divorced.

Whenever he went over, he would sit down and play. He improvised melodies, usually imagining a scene or something visual. “It was a comfortable place to be, and you could sort of travel with your imagination as you were playing,” the actor, 65, says via Zoom from his part-time home in Spain, the afternoon light spilling from the window behind him as he lights up a smoke.

“Even as a kid, I liked doing that. I always related music to images. I would imagine being somewhere.

” It’s only too clear in hindsight that Mortensen was, essentially, scoring a movie in his mind. Now he’s doing it for real. Mortensen has written and directed “The Dead Don’t Hurt,” a new western out Friday in which he also stars as a Danish immigrant handyman who leaves his bold new bride ( Vicky Krieps ) to serve in the Civil War.

As if that weren’t enough hats to wear, Mortensen composed the music, performing several instruments on the score. Mortensen, who also scored his 2020 directorial debut, “Falling,” joins a very exclusive club of directors who’ve created the music for their own films — from Charlie Chaplin and Clint Eastwood to Jeymes Samuel . But one doesn’t get the sense that this is some auteurist flex, or even simply a means to save on the music budget (as was the case for.