THE INSPIRATION for Douglas Maxwell's new play will not see it performed when it opens at the Royal Lyceum Theatre in Edinburgh this weekend. Nor did Maxwell's old friend Bob catch it when it was first staged by acting students at the Royal Conservatoire of Scotland in Glasgow last year. Without Bob, however, Charlie Sonata wouldn't exist. For Maxwell and everyone else left behind, the play is the only type of reunion they can ever have now. If Bob was still around, however, even though he'd cleaned up his act and settled down, they might not even have that.

“Bob died before I could show the play to him,” says Maxwell. “I wanted to write something in which he was this hero, and we could have a laugh about it, but we did the student production and I hadn't told him, and I don't know why. Even when David Greig took the play for the Lyceum, I still didn't tell him, and then it was too late. But his sister read the script, and she's given the green light now, which is great.”

To be clear, while Bob was the inspiration behind Charlie Sonata, and while there are similarities, it isn't really about him. Maxwell's tale starts off about an alcoholic prodigal's return home, in an attempt to rekindle old friendships and reclaim everything else he lost. As with most of Maxwell's plays, however, it takes a turn to the fantastical. As Charlie finds himself watching over the coma-stricken daughter of one of his friends, it becomes a skewed kind of fable.

“It's a play about a guy who comes back up for a reunion with his mates,” says Maxwell. “He's lost, and he's trying to make everything right, and it evolves into this fairytale about someone who wants to make things better. I think everyone has some kind of person like that in their life, who when the phone goes at two in the morning, you always know it's them. You can cope with that when you're in your twenties, and just about when you're in your thirties, but as you get older it becomes more difficult. The play has this group of people in their early forties, when this alcoholic comes back into their life. Charlie is someone with no violence or crime in him; the only damage he's doing is to himself, and he not only loses track of where he is, but when he is.

“It's one of those plays – and I'm in no way comparing myself to Arthur Miller – but structurally, it's kind of like Death of A Salesman. In that play, the main protagonist doesn't do anything. The play happens to him, and I think it's the same in Charlie Sonata. It begins and ends with a big speech, and in between he's incoherent.”

As with many of his plays, Maxwell wrote Charlie Sonata because he wanted to, and without anyone commissioning it. Maxwell prefers this approach, and, while he believes it frees up his writing, Charlie Sonata didn't come to him immediately.

“I had a few tries at it,” he says, “but then I was at a funeral, and I went back and looked at these scenes that I'd written, and everything changed. The scenes all fell into place, and after that the play really wrote itself.”

Maxwell's remark about how Charlie loses track of when he is, as much as where, was one of the key motives for director Matthew Lenton becoming involved in the production. In his role leading Vanishing Point theatre company, Lenton has consistently warped everyday realities into a form of magical realism that comes directly from an emotional impulse. Maxwell wrote the play specifically for Lenton, rekindling an affinity between the two which dates back to Lenton directing Mancub in a co-production between Vanishing Point and the National Theatre of Scotland. Both artists work instinctively, and, for all the intellectual rigour that goes with it, wear their hearts very much on their sleeves.

“I think Charlie Sonata is a very easy play to identify with emotionally,” says Lenton, “but I think it goes beyond that, in a more general feeling about care. For me, it's about what happens to someone if everyone around them pulls up short, and doesn't quite fulfil their role as a mate. I think it's also about how easy it is for someone to fall out from life, while everyone else around them carries on with their own lives.

“Douglas presents all that in such a magical and moving way. His plays are real and truthful, but they're not realistic. They have a kind of enhanced truthfulness. That's why that line about Charlie not knowing when he is, as well as where he is, stood out, and that's what I'm trying to bring out in this production. The challenge is to keep the spirit of the one we did at RCS, which we all really enjoyed doing, but to also allow it to grow and expand for the Lyceum stage.”

Charlie Sonata is the latest of Maxwell's works which might be conceivably seen as a cycle that charts his own growing pains as he gets older. Maxwell's breakout play, Decky Does A Bronco, first seen in 2000, looked at friendship through a child's eyes, as the play's narrator recalls a tragedy which has left its mark on those who survived it. Five years later, Mancub looked at a teenage boy coming to terms with the changes going on inside him.

Our Bad Magnet, which appeared the same year as Decky Does A Bronco, charts an uneasy reunion between four young men as it follows their friendship between the ages of nine and twenty-nine. In 2005, If Destroyed True looked at notions of community in a way that more recently, Maxwell's play for the Citizens Theatre, Glasgow, Fever Dream: Southside, continued to pursue.

“A lot of my plays are very similar in some respects,” Maxwell happily admits. “From the kids in Decky and Mancub to the people in their twenties in Our Bad Magnet and If Destroyed True. In Fever Dream: Southside they were in their thirties and having kids, and wondering if they could live in this particular place. Now here they are in Charlie Sonata, in their forties and wondering how that happened.”

Maxwell describes this as his “subterranean autobiography."

"When you write like me, you start at the source, and then you go off. These people are from my life, and as a playwright it's my job to put them in front of an audience and demand that audience's attention. They're not kings and queens, but they're living life as it's lived now, and these people matter. Part of the fairytale stuff in Charlie Sonata is to lift these people up so they have a higher value than you might initially think. Then once they have that higher value, you listen to them. That's when you realise how important they are.”

Charlie Sonata, Royal Lyceum Theatre, Edinburgh, April 29-May 13.

www.lyceum.org.uk