IT sounds like an idea straight out of the Johnny Cash songbook - a bunch of acclaimed musicians playing with some of the hardest criminals locked up in jail.

But rather than the Man in Black cranking up his guitar in America's infamous San Quentin prison, some of the most critically lauded singer-songwriters in Scotland have been making music in the nation's toughest jails.

The haunting and heartfelt songs deal with grief, childhood, love, loss and and longing. They were all created in prisons across Scotland by inmates, former prisoners and leading singer-songwriters including ex-Delgado Emma Pollok and Admiral Fallow frontman Louis Abbott, and will be released as a full length album.

The album – Not Known at this Address – is the work of Scottish arts organisation and charity Vox Liminus and aims to create a unique musical portrait of the criminal justice system. It highlights the difficulties faced by those who've served their sentence and want to re-integrate back into society. The musicians want to bring the struggles faced by prisoners to public attention, and move beyond the black and white view of offenders.

The songs were produced through the charity's Distant Voices project which for the last 18 months has held a series of workshops in prisons across Scotland including Barlinnie, Castle Huntly, Inverness and the young offenders institution Polmont. Musicians also collaborated with prison staff and former inmates attending community justice support projects.

Over 300 songs were produced, with the best ten selected for the album, which will be launched at live gigs on May 25 and 26. Demo recordings made behind bars were taken into the legendary Chem19 Studios, where full band arrangements were produced with the input of everyone involved in the project. Prisoners were able to record behind bars and their work was added later to the mix.

Some inmates said it helped them deal with family experiences that they had missed while in prison – one was behind bars when her father died and didn't get the chance to say goodbye – as well as the struggle to rebuild lives and relationships after release. One prisoner said that working alongside prison staff and musicians as equals allowed him to "practice" reintegrating into society ahead of his forthcoming release.

Alison Urie, director of Vox Liminus, said the launch of the album was a “significant” point in the project's evolution. "The album explores the experience of coming home and re-integrating," she said. "It can be quite alienating. They might be coming back to a home that has changed while they have been away, or they might be homeless, moving on to a hostel or even the streets. One prisoner we worked with was going back to his family but they had moved house. There is a feeling that everyone else keeps moving but you've been in suspension."

She added: "As a society we disproportionately imprison those from our most vulnerable groups - young people from the care system, those who have been excluded from schools or from the worst socio-economic areas. Stigma still exists."

Emma Pollok said she had learned a lot of about the criminal justice system in the course of project and claimed that for many she had worked with the root causes of their crimes could be traced back to poverty, a lack of guidance, role models and education. For the album she co-wrote a song titled I Won’t Follow Him To The Grave, inspired by the story of a young man who began using Valium following the death of his older brother. "His brother had been a huge influence on his life, not always a positive one, and the loss forced him to re-evaluate what he wanted for himself and his own young family," she said.

She claimed music could be "transformative" and give those in prison a form of release, adding: "They often don’t talk about their past in any detail with prison staff, or other prisoners, but in the songwriting sessions they are encouraged to do just that - to share elements of their life in order to write a song and in turn face some perhaps difficult episodes that have led to their sentencing.

"I’d really like this album to remind the public at large of the prison population and the myriad reasons why people find themselves in such terribly compromised situations. A modern society needs a modern approach to its justice system."

Louis Abbott of Admiral Fallow agreed that the process of creating the album had been a powerful one. "Writing words down to tell a story of some sort is an empowering thing in itself but there’s something about putting those stories to music that somehow makes them extra special. I think to a lot of people music is quite a magical thing and to hear their words become songs can feel exhilarating.

"Starting to understand some of the complexities that people with experience of the criminal justice system face has given me some insight into how incredibly difficult it can be for a lot of them just to exist."

A spokeswoman for the Scottish Prison Service said: "Drama and music projects are very effective at encouraging reluctant and disaffected learners to engage in creative activity. This in turn helps raise confidence and esteem and stimulates interest in more challenging educational activities."

THREE SONGS FROM THE SCOTTISH PRISON ALBUM

1. Collaboration: Glasgow-based singer songwriter Donna Maciocia and Shuggie in HMYOI Polmont

Track: Never Got to Say Goodbye

Shuggie says: "My Dad died earlier this year while I was in prison. I never got to say goodbye to him properly so writing this song felt a bit like that for me." Donna Maciocia adds: "I really admired how committed Shuggie was to seeing the song through from start to finish despite the evident emotional toll it was taking at points."

2. Collaboration: Glasgow six-piece band Pronto Mama and Frewsie in HMP Castle Huntly

Track: Rendez Vouz with Warpaint

Marc Rooney of Pronto Mama says: "Attempting to relate to and, at times, translate someone’s emotions and experiences of their formative years and create a song with them can be challenging but, undoubtedly, it’s gratifying." Frewsie adds: "I decided to write a song about a typical Friday night."

3. Contemporary folk musician Kris Drever and Steven Robinson HMP Inverness

Track: The Man I Used to Be

In this folky gem of a song Robinson writes about moving forward with his life, facing down his demons and breaking free. Robinson says: "I’d been on a troubled path for many years and had become very lost." Drever adds: "Engaging in these sessions helps turn statistics into individuals."

WHEN JOHNNY WENT TO SAN QUENTIN

The album At San Quentin was recorded live by Johnny Cash and his band at San Quentin State Prison in California on February 24, 1969 and released on June 4 of that same year. It remains a country and western classic to this day. San Quentin is the only jail in the state with a Death Row. It's also been home to infamous convicts such as Charles Manson. The concert was filmed and the album was the second in Cash's conceptual series of live prison albums that also included "At Folsom Prison" (1968) and "A Concert Behind Prison Walls" (1976).

The record includes hit songs such as Fulsom Prison Blues, Boy Named Sue, and I Walk the Line.