The Pink Floyd guitarist David Gilmour has recorded a new single featuring a choir formed by former inmates from the prison where his son served time.

Gilmour recorded Rattle That Lock with The Liberty Choir, a rehabilitation project that includes former Wandsworth Prison inmates and local singers.

His son Charlie served time in Wandsworth in south London in 2011 after being arrested at a tuition fees protest.

He spent four months in jail after being convicted of violent disorder for his part in the 2010 protest, where he swung from a flag on the Cenotaph and threw a bin at a royal convoy.

Gilmour, who this week visited the prison and sang with the choir, said: “Charlie's experience was something that has impacted on us and has made us more aware of the prison system and what could and should be done to improve it.” The choir gives prisoners "real hope and optimism”, the musician said. "Singing in choirs is a joy that should be open to all. I’m delighted to have the choir singing on my new album, and hearing them get radio play.”

Former inmates are encouraged to continue singing with the 30-strong choir, founded by vocal coach MJ Paranzino and writer Ginny Dougary, after their release as part of their rehabilitation programme.