In the Bible, a story is recounted where Jesus' key followers (apostles) were imprisoned in jail. Then they were beaten and tortured.
But they refused to recant and so they were thrown into jail.
Locked up in a stinking ancient jail with severe wounds is no joke.
Yet, the apostles encouraged each other by singing psalms in praise of God. And then suddenly an Angel of the Lord appeared and freed them.
There is also an earlier story of how David, who later became king, was summoned to play music for King Saul. Saul was afflicted with a demon but when David played the harp, his psychosis or demon went away.
I do believe that in times of depression, it is good for us- to sing praises to God. When it hurts, sing.
The problem with people is that they are more liable to play music that fits into their depression and anger- making their temperament and psychology worse.