We're standing on the dead – a jagged path of headstones leading to the front door of St Nicholas Church in Aberdeen.

When Stuart MacBride first came to this place as a boy, his dad would freak him out by telling him he was walking on dead people, which is the kind of dark thought that can stick in a young boy's brain. It might explain why MacBride grew up to write the sort of novels he's famous for – novels in which dead bodies play a starring role.

The first of those novels, Cold Granite, was published in 2005 and sent MacBride straight into the top three or four of Scottish crime writers, although it also attracted criticism and disgust from some. Many were turned off by the violence and blood and bad language; others were turned on by his gift for a one- liner and dialogue that sounded like it was real.

Loading article content

Today MacBride, 43, has taken me to St Nicholas Church as part of a tour of the places that inspired Cold Granite, and the 10 novels that have followed, including his new one, Close to the Bone. He calls the kirkyard a doom-laden place and I can see what he means – not only are we standing on a path made up of the mourned and the forgotten, we're also surrounded on all sides by great walls of granite – and on a cold day like this, the granite glowers.

Over the years, this grey churchyard has featured in several of MacBride's books as a place to run, or hide, or think. MacBride was four years old when he was first taken here, two years after moving from Clydebank to Aberdeen. He's never lived anywhere else since and loves the place, although it took him a while to work out the city would be a good location for a modern crime novel.

"I first thought of setting it in either Glasgow or Edinburgh, which everybody does, and then I thought: Why not Aberdeen?" he says. "Scotland is only now starting to get over this whole thing where you have to be in Glasgow or Edinburgh to write crime fiction. Scotland is starting to come alive with different people writing different stories."

We start to head out of the churchyard, past a tomb whose lid has shifted, revealing a disturbing, dark gap, and MacBride tells me a little more about his childhood. His mother was from Clydebank, his dad from the Black Isle and they both worked in catering. He was the kind of boy – rare and getting rarer – who reads a lot and it was always detectives: first the Hardy Boys, then a bit of a jump to Dashiell Hammett. His grandmother, however, thought he was good at drawing and suggested architecture as a career.

"I'd been told my entire life I would be an architect," says MacBride. "But then I got to university and discovered it was the most appallingly dull subject ever devised." He took a year out and never went back.

We're walking up from the kirkyard now, heading towards the Grampian Police HQ, all girders and 1970s cement, which is at the heart of most of MacBride's novels. MacBride writes police procedurals featuring a copper called Logan McRae who is not just an anti-hero, he's an anti-anti-hero – there are no quirks or great character flaws, just an ordinary guy with a bad diet and bad relationships.

"I wanted him to be different from other detectives," says MacBride. "Detectives always have big personalities but they also always have a sidekick and I thought it would be interesting to do it the other way round and make the sidekick the central character."

So that's what he did and the result was Detective Inspector McRae, a man with ragged edges who is entirely different from MacBride himself, who is soft-spoken, self-deprecating and gentle, so gentle in fact it's hard to imagine him doing the first job he did after leaving his architecture course: steward on an oil rig.

"I was far too young to go at 18," he says. "There was a reason the guys who went offshore were called bears. In those days, in the early 1990s, you got paid at the end of your two weeks offshore and you were run into town on a minibus and dumped outside one of the pubs. You'd get half your wages in cash and half in a cheque and the reason was you couldn't spend a cheque in the pub. A lot of the guys would go absolutely mental."

MacBride stuck it out for a year, spending a lot of his time reading books, before heading back onshore to start a career in marketing and design. In fact, we're heading to his old office now, near the harbour, but first he wants to show me something. He points up to a block of flats, granite and grey. The top floor is where Logan McRae lives. It's his 221b Baker Street.

We start walking again and reach MacBride's old office, just along the street. For years, MacBride wrote fiction as a hobby at night (mainly science fiction) before getting a book deal for his fifth effort, Cold Granite, while doing office shifts during the day. The office backs on to Shore Lane, where Aberdeen's prostitutes do business (wags often paint out the S in Shore) and even in broad daylight, it's an unfriendly place. You can see why it ended up in his books.

"If you get a really big downpour," he says as we walk down the lane, "the rats drown in the sewers and bob to the surface. The smell is spectacular and I've put it all into my books."

As MacBride has discovered, some critics and readers don't like that: the full-frontal grimness, the violence, the honesty about sex and blood and crime. MacBride, though, says he wouldn't change a thing.

"It would be difficult to do a contemporary crime novel about the vicar killing the lord of the manor in the library," he says. "It's not the kind of noir stuff we're doing nowadays. I want the reader to experience what Logan experiences – I don't want this big filter that says 'look away now gentle reader, this is not for you'."

Interestingly, the new novel, Close to the Bone, features a subplot in which a novelist is implicated in causing real crime and I ask MacBride if he was trying to address something novelists like him are sometimes accused of?

"People say: 'what would you do if somebody used your books as a spur to violence, does that worry you?' But it doesn't matter what you write, people in real life are always going to do much worse things. Even if somebody did take an idea from a book, that's somebody who is going to take an idea from somewhere."

We start heading back to the centre of town and MacBride tells me what it's been like adjusting to success as a writer – success that was sudden and swift (he's written 11 novels in seven years, with only four days off a year). Even now, he struggles with it all and occasionally puts on a self-mocking foppish "writer" voice as if to protect himself from accusations of pretentiousness by sending himself up first. It's probably living in Aberdeen that does it: this might be an oil capital but it's strangely inward- looking too; everyone knows everyone else and keeps everyone in their place.

"There are all these people who will keep you grounded," says MacBride. "And I can't imagine being the kind of person who would go around saying, don't you know who I am?"

It's a healthy attitude, as is MacBride's approach to his own writing. He works from an office in his house, where he lives with his wife Fiona and a cat, Grendel, and he tells me he spent the previous night trying to work out why he's unhappy with his current project – a novel featuring one of his other police characters, Ash Henderson. He says he spends most of his time deleting what he's just written.

What helps is that MacBride does believe his work is important – the crime novel, he says (although he's wary of being pretentious again) is a mirror for our fears in society.

"Beowulf is basically a serial killer reflecting the fears of the day," he says. "Jeykll and Hyde is a fear of sex. Society gets the monsters it wants. We had paedophile killers and cannibals and we're probably going to go back to paedophiles again because of Jimmy Savile."

There's no doubt MacBride is willing to tackle those kind of subjects, to the delight of some readers and the horror of others. One agent said he was sick and twisted, one reader called him an affront to God, but if there's anything MacBride loves writing about, it's the darkness in this glittering city. On one page of his new book, he says the buildings look like someone has sneezed glitter into them but on another, he says the sun is like a glowing fag end pressed into pale skin.

"That's what I love about Aberdeen," he says. "On a horrible day it's dark and messy but on a sunny day, it glitters and shines."

Career high?
Being recognised by the guy on the till at my local Lidl. Doesn’t get much more showbiz than that, does it?

Career low?
Giving the Address to the Lassies at the Scottish Book Association Burns Supper. It was so awful I issued a formal apology to anyone who sat through it.

Favourite film?
Groundhog Day – we’ve watched it over and over again. Appropriately enough.

Favourite book?
That changes from day to day, but right now it’s Stuck by Oliver Jeffers.

Favourite holiday?
A week on Mull, in the autumn.

Favourite meal?
Crispy pork belly.

Best advice received?
That would be from my second agent, Mark: “Why don’t you try writing a straight detective novel?”

Perfect dinner party guests?
Bernard Cornwell; Val McDermid; Allan Guthrie; Sandi Toksvig, pictured;  MC Beaton; Rabbi Lionel Blue; and most importantly, my wife Fiona.

Close to the Bone is published by HarperCollins this week at £16.99.

Stuart macbride, crime writer