FINALLY, in the year 2017, the first great Airdrie novel has arrived. Come to that, it may also be the first Airdrie novel.

David Keenan’s This Is Memorial Device, set in a post-punk version of the town circa 1978 to 1986, is full of music and mystery and myth. It contains wannabe pop stars, porn stars, IRA members in hiding, deviant sex, murderous violence, urine-tasting and lines that cut through and cut deep. (My favourite might be: “Early Elvis. Young Elvis. Elvis where he looked like a flick knife.” There’s all the threat and thrill of rock and roll summed up in eight words.)

Ostensibly the story of a band called Memorial Device, the novel is dark, dreamy, delirious; a vision, as its author suggests, of a hallucinated Airdrie, told through conflicting voices and the maze of fiction. A dream Airdrie if you like, sometimes shading towards nightmare.

Today the north Lanarkshire town feels mostly cold. It is early January and Keenan is giving me a tour. A tour of his own past and of the book’s setting and the points where those two things overlap and separate. (Yes, he says, he’s tasted his own urine. “First it’s kind of bogging but after it’s quite nice.”)

Right now we are standing outside the Harp And Shamrock pub in Anderson Street in the town. A long time ago – the early 1980s to be exact – this is where the town’s hipper kids hung out.

“Yeah, it’s changed a lot,” Keenan says. “This was the cool bar where people would hang out and plot.” Across the road, he continues, turning, was an arts centre that was buzzing back then. Now it’s an empty building. The past is a palimpsest on the present.

Keenan lived here between the ages of seven and 17, after moving to the town from Glasgow's east end. He’s since returned to Glasgow where he lives with his American wife, the musician Heather Leigh. But he has retained a real fondness for the town he grew up in. “People think of it as a place that is quite poor – which it is – and rough – and it certainly can be. Part of the Buckfast triangle, etc, etc,” he admits.

“But Airdrie has a unique identity. It’s a strange, strange place. In the book I mention the Airdrie Savings Bank, which is the oldest savings bank in the whole of the UK, and that ties into something strange about Airdrie. It has one of the least mobile populations in the UK. People don’t leave … Or maybe,” he laughs, “it’s just hard to escape.

“I know from the outside it can look ghastly. It won that Plook on the Plinth for the ugliest city centre,” he continues. “But to me that wasn’t my experience of it. So when I was writing the book I wanted it be much more about the magic and surreal aspect of Airdrie. There’s a lot of eccentric people hidden in Airdrie. It has an ugly façade, but as one of the characters says in the book, that just serves to keep out the curious.”

We have arrived at Airdrie library, one of the key locations for the younger Keenan. “This smells exactly the same as it did in 1978,” his 2017 equivalent notes.

There is an observatory on top of the building. Keenan himself joined the Airdrie Astronomical Society (aka Astra) at the end of the 1970s. “This was another haven for very eccentric people. They would mostly meet up to listen to heavy metal and look at sunspots.”

It was music and books that inspired Keenan back then. “I got into weird music or strange culture through things like science fiction and astronomy and probably heavy metal. It was like: ‘Well, if you like Philip K Dick … If you think Iron Maiden are heavy …’

“Then I began to get more involved in the underground scene, the music scene, the alternative scene.”

Post-punk fired him up too. That moment in British culture where ambition and originality were writ large. In Airdrie as much as anywhere else. “I think the most interesting stuff about post-punk was what happened outside the urban centres, in the small villages.

“What happens in This Is Memorial Device happened in a lot of small towns I think. It’s an international scene in microcosm. So you have your local Iggy Pop, you have your local Lou Reed. And as one of the characters says, in a way the people in Airdrie were living it harder than their role models. It’s not easy being Iggy Pop in Airdrie.”

In some ways This Is Memorial Device is a romance then. It draws on Keenan’s own hazy memories of first girlfriends, days swimming in abandoned quarries, pulling leeches off his legs and getting bitten by pikes.

“I did want to memorialise certainly,” Keenan admits. “And I wanted to show the magic that would happen behind the scenes in these towns. I wanted to show how post-punk had energised people.”

But more than that the book is about how we process experience. “It’s a lot about memory. A lot about moments. Do moments exist? Can moments be preserved?”

As we walk up South Bridge Street, he talks of being inspired by the French author Georges Perec and his book Life: A User’s Manual. “He used a schematic in which he plots the lives of all the people in an apartment block and how they interconnect. I wanted to do the same but plot it for a small town at a certain time.”

That was just the beginning though. “There’s a recurring theme in the book about the organs of the body and I had this idea that what you could do in order to bring a book alive was you almost need to build a body. The chapters sort of become the book’s internal organs and a way of bringing blood to the organs is to move these characters in a certain way. It’s like Adam Kadmon, the original Adam, or even like the Jewish idea of the Golem that can be brought alive using language.”

You won’t be surprised to learn that Keenan is obsessed with the Kabbalah, an esoteric form of Jewish mysticism. But maybe language and its magical properties can be seen as a Scottish thing too, he suggests. “People in Airdrie and Glasgow are obsessed by language. That’s why it’s a delight for a writer just to listen, to hear the patter, the rhythm and the joy in language.”

Keenan has some 25 years of playing with language behind him too. Over lunch at the Tudor Hotel – the same place his parents had their wedding reception – he lays it out for me. The teenage Keenan was inspired by discovering the writing of the music critic Lester Bangs’s book Psychotic Reactions And Carburettor Dung, “I like Lester Bangs as much as I like any of my favourite rock records. I read Psychotic Reactions in the same way I listen to Lou Reed.”

He wrote his first piece for a fanzine when he was just 16. Soon he was writing for the music press. He tried his hand at music too. There was a brief spell in a band, 18 Wheeler, who supported Oasis on the night the Gallagher brothers were spotted by Alan McGee, but it’s not an experience Keenan looks back on with any great pleasure.

He was with the band for just the one single. “It was a horrible experience. Horrible. I’ve got no good memories of it and I bailed as quickly as possible. A complete bunch of dicks. The music was complete shit. It was really disillusioning.”

He also had a spell working with Ricky Gervais at XFM but when Capital bought the radio station he took a redundancy package and committed to music writing for magazines like The Wire. He even spent some time as this paper’s jazz critic. He also ran a record shop in Glasgow for a while.

But he’s now in love with fiction. He spent 10 years writing fiction without letting anyone see it. “I didn’t have any idea how to write a book at all. I started and it was absolutely horrible. I was just getting all this dreck out of my system. So I decided to spend two years writing this horrible book. I would complete it and then I would ritually destroy it. If you are able to do that and start again then maybe you can be a writer.”

This Is Memorial Device is proof that he is. The result is a form of Lanarkshire magic realism.

“I think the surreal aspect of it is closer to the truth in a way,” he says. “The strange, unlikely, supernatural, hallucinated part was somehow closer to the real experience. And something tells me that’s closer to how people experience reality. Things do seem hallucinated and weird. You’re invaded mentally by all these weird ideas at the same time and memory itself twists and turns it. Memory itself is creative. Rather than some weird fidelity to some social realist notion of Airdrie in 1978 I wanted to get the psychic reality of Airdrie, '78.”

I think he succeeds. A week after we speak the Airdrie Savings Bank will announce it is closing.

This Is Memorial Device, by David Keenan, is published by Faber & Faber, £14.99