AMERICAN composer Philip Glass has the characteristic dry humour of the city of New York, from where he is speaking to me.

"If you live a long time, you can make a living out of opera," he says, having composed something over thirty works that might be described as such, or as music theatre. Glass's 80th birthday falls in the middle of the run of Scottish performances of a revival of his 2014 chamber opera The Trial, based on the seminal book by Franz Kafka, written 100 years earlier.

It is one of the growing list of works on which he has collaborated with playwright Christopher Hampton, a decade his junior, who, curiously, will also be celebrating a birthday (his 71st) during the Glasgow shows.

Glass's vast catalogue, of course, encompasses much more than opera, with film soundtracks and his symphonic treatment of the themes on David Bowie's Berlin-period albums probably the works that have found him the widest audience. But he is clear that combining words and music for the stage is at the top of the list of his activities, and the partnerships that have created the Kafka adaptation have proved particularly fruitful in recent years.

The work is directed by Michael McCarthy for Music Theatre Wales, following on from his staging of another Kafka story, In The Penal Colony, and Edgar Allen Poe's The Fall of The House of Usher. The Trial premiered at the Linbury space at the Royal Opera House, Covent Garden and subsequently toured across England, Wales, and Germany. For this revival, Scottish Opera has come onboard as co-producer, alongside the Welsh and London companies and Germany's Theater Magdeburg, supplying three of the cast of eight – Emma Kerr, Hazel McBain and Elgan Llyr Thomas – from its Emerging Artists programme.

"I don't like to be without an opera on my desk," says Glass, "and these smaller scale pieces are what I do between big operas. I've found that experimental theatre companies are prepared to take on these things, and it is a handy form to work in, not requiring huge budgets.

"They are small only in terms of the resources required, not in terms of dramatic content. The Trial takes on nothing less than the whole of modern civilisation."

Like Glass, Hampton read Kafka's classic as a teenager, when the popular English translation was the work of Scots poet Edwin Muir and his wife Willa. He was also was "very taken" by the 1962 Orson Welles film adaptation, but he went back to the original text for his libretto. Alongside writing and directing, translating has been an essential part of Hampton's business, with a new staging of his version of Yasmina Reza's French play, Art, currently running at the Old Vic starring Rufus Sewell. Next on his agenda is the Broadway revival of Sunset Boulevard, the musical he wrote with Andrew Lloyd-Webber and Don Black.

"I love going from one world to another and finding different ways of doing things," he says. "With Lloyd-Webber you are given the music and and have to fit the lyrics to the score. Philip Glass writes not a note until he has the libretto, and then he will call if he wants to make a cut or needs a couple more syllables. He is the perfect collaborator because he makes every effort to honour the text and make sure every word is heard."

Hampton says that his only instruction from Glass was that his work was no more than 45 pages long. "The timescale is such that a lot of the incident in the book has to refined down – you have to extract the essential. But it is the dry humour of the book that appealed to both of us, so that is the tone. It is the most prophetic book of the 20th century – the weird complicity of the victim, Josef K, is very 20th century."

For his part, Glass is full of praise for Hampton. The pair first worked together when Glass provided the soundtrack to Hampton's 1996 film version of Joseph Conrad's The Secret Agent, which starred Bob Hoskins, Patricia Arquette, Gérard Depardieu and Christian Bale. Glass asked if Hampton had ever written opera libretto, and discovering a gap in his experience, promised to be in touch. A decade later, they made their first collaboration, Appomattox, which the writer has since used as the basis for an acclaimed American history play that premiered at the Guthrie theatre in Minneapolis

"A composer needs a good librettist," says Glass, "but he does everything so well – look at Liaisons Dangereuses, both the movie and the play. He knows what will work on stage.

"By contrast Kafka was totally unknown in his lifetime, but The Trial is begging to be put on a stage. It was black comedy to him, and 30 years before Orwell he had this vision of a starker world, at a time, before World War One, when people were generally more optimistic. Where did he get his ideas from?"

Glass says that the shape of the work is in his head at the start, but then he and his collaborators have to work out how to get from scene to scene, and answer questions like where the tragic moments in the piece should be.

"The Music Theatre Wales people are very skilled at this kind of thing. I have a good time working with them and some limitations can be positive – the double casting is The Trial turned out very interesting. A small orchestra is what we can afford and eight singers, but great versatility is required – it is not a student end-of-term work."

The Trial is at Theatre Royal, Glasgow January 24, 26, and 28 and King's Theatre, Edinburgh February 3 and 4.