Rob Morsberger is enjoying revisiting old haunts in Edinburgh: 26 years ago, the Edinburgh University music graduate left for New York, where he hardly knew anybody, and fell into the kind of lifestyle he had always wanted.

He has worked on television documentaries, using his classical training on scores for long-running successes including science programme Nova. Over the past 17 years, he has led a high-calibre band – including sometime Steely Dan musical director, guitarist Jon Herington – as a vehicle for his song-writing. As a studio musician, he has provided string quartet arrangements and played keyboards on Patti Smith's latest album, Banga, played accordion on Loudon Wainwright III's Older Than My Old Man Now and collaborated with Brad Roberts of the Crash Test Dummies, Willie Nile, Marshall Crenshaw and Suzzy Roche of The Roches.

His life sounds perfect – and he confirms that it is, except that the album he's currently working on with Suzzy Roche will, he says, probably be his last project.

Last September, while finishing off his Ghosts Before Breakfast album, 52-year-old Morsberger began to suffer severe headaches. He was subsequently diagnosed with Grade 4 glioblastoma, the most severe form of brain cancer, and had a tumour removed.

He has since had a further tumour removed and knows his life expectancy is short. So his trip back to Edinburgh, where he played a house concert at photographer Douglas Robertson's home-cum-studio, is probably his last look around the city.

"I have no regrets apart from the fact my youngest son, Elan, who's seven, won't have a dad," he says. "It sounds a little corny to talk about dreams but I've done everything I wanted to do, and not many people can say that, and working with Suzzy Roche really is a dream come true. I'm proud of my work."

American by birth, Morsberger grew up in Oxford. His father, an artist who had previously moved from university post to university post, became head of art at Oxford University when Morsberger was 12 and the family settled into the English way of life. On leaving school, Morsberger, by then a bassoonist who also played piano, won a scholarship to study music in Edinburgh. Kenneth Leighton, whom Morsberger regards as a world-class composer, was then head of the department and his fellow students included James MacMillan.

"I took eight years to finish my degree, rather than four," he says. "I met people like Steve Kettley, the saxophonist, and Dave Conway, the bass guitarist, and joined their jazz and jazz-rock bands and probably spent more time working with my Fender Rhodes piano and synthesisers than was good for a music student. But I learned a lot in those bands that's since come in useful and by the end of my time in Edinburgh I was beginning to get commissions for Scottish Ballet and the BBC and I'd started working as an accompanist for dance companies, which was also useful experience when I moved to New York."

As an American, Morsberger felt the pull of New York strongly. He arrived with no plans but did the usual things including placing advertisements in the Village Voice, looking for work, and he fairly quickly found the Big Apple's reputation as a city of opportunity to be true.

"There's an extraordinary openness to let you do what you want to do and a vitality, as well as a depth of talent to draw on, that I found really inspiring," he says. "I made my first album right away. I'd always written songs and within months of arriving I'd formed a band and was playing at the CBGB whose owner, Hilly Kristal, became a friend and was so supportive."

When his first son arrived – he now has three sons and a daughter – Morsberger became a stay-at-home dad, looking after his young boy and working on music for television. In 1995, while still doing TV scores, he went back out to work, forming his band with Jon Herington, doing string arrangements for producers including Stewart Lerman, which is how he came to work with Patti Smith at the legendary Electric Lady studio, and performing as a singer-songwriter, including gigs with Loudon Wainwright III.

"I stopped doing the scoring work when I became ill," he says. "Although I always tried to make it as artistic as possible, I felt it wasn't the art I wanted to concentrate on."

Rather than slowing him down, living with his illness has made him more focused and able to work more quickly. He's had a very productive year, including writing and recording his album A Part Of You, a deeply personal work that addresses his illness and shows his and young Elan's hands clasped together on the cover. And, despite his dire prognosis, he considers himself very lucky.

"The medication hasn't been a problem, like it can be for some people, and the surgery has been amazing; I was out the next day," he says. "I might not be quite so cheerful later but right now I'm giving myself four months, based on reasonable estimates. Anything more than that will be a bonus."