'I can see the stars.

I can see where I am in the universe at any time. I can do art.”

I’m sitting outside a cafe in St Andrews with 39-year-old musician and songwriter Gordon Anderson. He’s actually talking about his iPhone but he could equally be describing the powers of his other-worldly alter ego: Lone Pigeon, the most fragile and mysterious member of the fraternity of Fife musicians which makes up the Fence Collective.

If Anstruther is Fence’s HQ, St Andrews is its spiritual home. It was here that Anderson grew up with twin brother Ian and older brother Kenny, who runs the Fence label and records as King Creosote, and where he formed the schoolyard friendships that birthed The Beta Band, of which he was a founder member. And it was to St Andrews he returned when he became too ill to function, just days after the band had signed to EMI. Or, as he puts it, when he suffered “a demonic attack on my personality and on my soul”. Whatever it was, it wiped out his twenties. But more of that later.

Right now the only thing being attacked is a large cappuccino. Notionally I’m here because of Time Capsule, a seven-CD collection of Lone Pigeon recordings released this week by Domino, the label Arctic Monkeys call home. But there are other subjects to be covered, too. As well as The Beta Band itself, there’s the Fence phenomenon and The Aliens, the group Anderson formed in 2005 out of the ashes of The Beta Band.

Time Capsule is a decade’s worth of Lone Pigeon recordings, mostly homespun and captured on an arsenal of devices which include cannibalised karaoke machines and high-end 16-track digital recorders. There are songs whose titles seem more like coded messages between lovers – Sdlmnm (Organs), Lonely As Shxt – and others, such as Summertyme Beeswing, Oceanairy and Heaventree, which conjure up the lanes, lairs and inlets of Anderson’s East Neuk stomping ground. One of the albums is simply called 28 Secret Tracks and, naturally, it has no track listing at all. One composition, Waterfall, may be the most beautiful song you’ve never heard.

Kenny Anderson thinks his brother has around 1000 recordings. The man himself isn’t so sure. “I think it’s far more than that. I should go back and count them. I have so much stuff there.” He does know he has many computer hard drives and that most of them are full. Some he can’t even access any more.

Given that, trying to unravel his songs’ provenance or impose timelines on them is a little difficult. We do know that, as Lone Pigeon, Anderson has released one previous album on Domino, 2002’s Concubine Rice. Most of the other albums were issued by Kenny Anderson on the Fence imprint. There have also been EPs and even a B-side to a track by fellow Fence artist James Yorkston. A few of the songs in the Time Capsule collection also ended up on the first Aliens album, 2007’s Astronomy For Dogs, though in very different versions.

You could say The Aliens was Gordon Anderson’s second chance at The Beta Band. That group had originally come together in London in the mid-1990s as The Pigeons, formed around a nucleus of him, schoolfriend and fellow Edinburgh College of Art graduate John Maclean, Robin Jones and another St Andrews friend, Steve Mason. Maclean, Jones and later Mason lived in a squat in Shepherd’s Bush. Anderson lived nearby with a girlfriend. It was her, fatefully, who handed a tape of what would become The Beta Band’s Champion Versions EP to a friend at EMI.

The group was signed almost immediately. Equally sudden was the onset of Anderson’s illness. Now a committed Christian who attends church regularly, he doesn’t accept labels like “schizophrenia”. He did take drugs to excess, he admits, but doesn’t think that was what caused the breakdown. Whatever it was, it hospitalised him and robbed him of six years of his life. The Beta Band were forced to continue without him.

‘I got 144 electric shocks to the head,” he says. “It was a horrible time. A time that’s so dark that I barely go back there in my memory. It’s like stepping into a pool of black oil.”

He was also put on medication. It made him shake. At one point, he was paralysed down one side. “I was lying in bed, this thing was gnawing into me, creeping through my soul every day, taking over my thoughts. I changed to something else that I could not explain. So I lost everything: I lost my band, I lost my girlfriend, I lost my future.”

The “lost” band he made up for when he formed The Aliens, at least in part. And with a wry smile he tells me about the “girlfriends galore” he had in the years after he came out of hospital, when he was living in St Andrews, performing music and watching brother Kenny get the Fence label off the ground. “I had a period when I just needed to be young,” he says. He even wrote a lyric about it: “I was a boy when they locked me away and strapped me to the empty chair.”

Drug-free and healthy, he found a future, too, though it’s now become his past: a decade’s worth of strange, whimsical, psychedelic recordings. And what will the coming years bring Gordon Anderson? He’d like to write a “classic” album, he says, but beyond that, who knows? Not even his iPhone can answer that one.

Time Capsule is released tomorrow by Domino, priced £50. Lone Pigeon plays St Paul’s Church Hall, Edinburgh on Thursday and The Blue Lamp, Aberdeen on Friday