The oratorio All the Hills and Vales Along will be performed as part of The Cumnock Tryst festival in Ayrshire on Saturday evening.
The work was commissioned by the London Symphony Orchestra and 14-18 NOW, the UK arts programme for the First World War centenary, to commemorate 100 years since the end of the First World War.
The composition is set to five poems by the Aberdeen-born war poet Charles Hamilton Sorley and will be performed by Ian Bostridge, the Edinburgh Quartet, Nikita Naumov, Sirocco Winds, the Dalmellington Band and the Cumnock Tryst Festival Chorus.
After the premiere of the chamber version of the work at Cumnock Old Church on Saturday, the full orchestral version will be premiered at the Barbican in London on November 4.
The festival was created and is run by Sir James, who grew up in Cumnock.
Speaking about the new work in the summer, he said: “I wanted to mark our fifth festival by writing a special new piece.
“All the Hills and Vales Along will bring together some of our starry visitors with the local Dallmellington Band and the Festival Chorus conducted by Eamonn Dougan.
“I have been waiting for a long time to write this piece for Cumnock.”
Charles Hamilton Sorley was killed at the Battle of Loos, aged 20.
This year’s festival, which began on Thursday, runs until Sunday and is supported by Creative Scotland, East Ayrshire Leisure Trust, 14-18 NOW, Genesis Foundation, William Grant Foundation, and Howard and Roberta Ahmanson, among others.