John Hartford, who wrote the standard Gentle on My Mind and turned his back on Hollywood to return to bluegrass music, has died aged 63 after a long battle with cancer.

Gentle on My Mind has been broadcast on radio or television more than six million times, according to Broadcast Music Incorporated, which collects song royalties. It has been recorded more than 300 times, most prominently by Glen Campbell in 1967.

Hartford's career rambled from Hollywood to Nashville, with stops writing and performing on network television, thousands of shows at bluegrass clubs and festivals, and stints as a licensed steamboat pilot on the Mississippi River.

Hartford was once forced to choose between the two great passions in his life - music and the Mississippi riverboats. He concentrated on music for a time, to establish a career, but he never abandoned the riverboats and used to serve as a crew member on the Julia Belle Swain.

When he came to Glasgow in 1977 it was natural that he found his way to the Waverley for a photocall.

At the height of his fame in the early 1970s, Hartford went back on a decision to accept an offer to star in a detective series on American television. Instead, he returned to Nashville and resumed his career as an innovative, relatively low-profile, bluegrass singer-songwriter. ''I knew that if I did it, I would never live it down,'' Hartford said of the television series in a 2000 interview. ''Because then when I went back to music, people would start saying, 'Oh, he didn't make it in acting so he's gone country'.''

Born in New York City and raised in St Louis, Hartford was enthralled as a youngster by riverboats and bluegrass music, in particular that of Lester Flatt and Earl Scruggs. He moved to Nashville in 1965, and his first album, John Hartford Looks at Life, was released the following year.

Hartford's version of Gentle on My Mind from his second album, Earthwords & Music, was a minor hit in 1967. The song is about a hobo whose mind is eased by the thought of a former lover. Hartford moved to California in 1968, landing a job writing and performing on The Smothers Brothers Comedy Hour. His went on to the cast of The Glen Campbell Goodtime Hour.

Returning to Nashville in 1971, Hartford released the landmark acoustic album Aereo-Plain and continued to record until his death.

In 1999 he accepted that one side-effect of his cancer was that he did not have the stamina he once had. He planned to cut down on touring in support of his new albums. ''I probably have two years left,'' he said. ''Promoting a record is a lot less important to me than having a heck of a time with what I've got left.''