When Paul and Silas were thrown into prison in Philippi, at midnight Paul and Silas were praying and singing hymns to God, and the prisoners were listening to them.
The word "listening" used here is significant. In the original language, it means to listen very, very carefully. Another way to translate it is "they listened with pleasure." There are some things that aren't a pleasure to listen to — they are painful, like fingernails on a chalkboard. But this was pleasurable, like when your favorite song comes on the radio and you turn it up. Oh, I love this song! This is a great song! That is how the prisoners were listening.
I doubt they had ever heard anyone sing in that dungeon before. And I think the simple fact that they were singing at all in such a place was a powerful testimony. It was a platform for evangelism. You see, you can talk about trusting God in adversity, but when someone sees it in action in your life, there is an undeniable authenticity. It is a powerful witness. Worship can be a powerful tool for a nonbeliever to be exposed to.
When you are in pain, the midnight hour is not the easiest time for a worship service. But God can give you songs in the night. And never doubt it: people will be listening.