"What is the meaning of the verse 'I will sing to the Lord, for he is highly exalted'? Rabbi Yudan said that this refers to what is written in Psalms 71:7, 'I have become a sign to many; you are my strong refuge.' David said, 'I did not sing a song until I was disgraced and until four fell into my hand and until I had dominion over Baal of the fingers.' So too, Israel does not sing a song until they are disgraced and until four fall into their hands and Baal of the fingers.

This is the meaning of 'I have become a sign to many, and you are my strong refuge.' How did David become disgraced? He revealed the Philistine's secrets (see 1 Samuel 17) and disgraced Israel, and cursed David, and he fell into his hand. And Baal of the fingers (see 2 Samuel 21:20) was a man from Judah with six fingers on each hand, and four of his descendants fell before David (see 2 Samuel 21:22).

David spoke this song to the Lord (see 2 Samuel 22:1). Similarly, when the Messiah comes quickly in our days, we do not sing a song until the Messiah is disgraced, as it is written in Psalms 69:10, 'Because zeal for your house consumes me, and the insults of those who insult you fall on me.' And until four wicked empires fall before him, as it is written in Zechariah 14:2, 'I will gather all the nations to Jerusalem,' and then the Lord will go out and fight.

At that time, one should say a new song to the Lord, as it is written in Psalms 98:1, 'Sing to the Lord a new song, for he has done marvelous things.'"