King David Woke at Midnight to Thank God

Pesikta DeRav Kahana 7:4

[4] "At midnight I rise to give thanks to You for Your righteous judgments" (Psalms 119:62). Rabbi Pinhas in the name of Rabbi Elazar son of Rabbi Menahem: What did David do? He would take a harp and a lyre and place them at his head, and rise at midnight and play upon them; and the sages of Israel would hear his voice and say, "If David the king occupies himself with Torah, we all the more so," and it would turn out that all Israel was occupied with Torah. Rabbi Levi said: There was a window over David's bed that opened to the north, and the lyre was hung opposite it, and the north wind would come forth at midnight and blow upon it, and the lyre would play of itself. This is the meaning of what is written, "And it came to pass, as the musician played" (2 Kings 3:16); "as one plays upon an instrument" is not said, but rather "as the musician played"; the lyre played of itself. And all Israel would hear his voice and say, "If David the king does so, we all the more so," and it would turn out that all Israel was occupied with Torah. This is what David said, "Awake, my glory; awake, O harp and lyre; I will awaken the dawn" (Psalms 57:9); awake, my honor, before the honor of my Creator; my honor is reckoned as nothing before the honor of my Creator. "I will awaken the dawn" (there), I awaken the dawn, and the dawn does not awaken me. And his evil inclination would provoke him and say to him: David, it is the way of kings that the dawn awakens them, and you say, "I will awaken the dawn"; it is the way of kings to sleep until the third hour, and you say, "At midnight I rise to give thanks to You" (there, 119:62). And what is "for Your righteous judgments" (there)? For the judgments You brought upon Pharaoh the wicked and the righteousness You did with Sarah my grandmother, as it is written, "And the LORD afflicted Pharaoh with great plagues," and so forth (Genesis 12:17). Another interpretation: "for Your righteous judgments" (Psalms, there), for the judgments You brought upon the nations of the world, and for the righteousness You did with my grandfather and with my grandmother; for had she let slip down to her a single curse from below, from where would I have been standing? Rather, You placed in his heart a blessing: "Blessed are you to the LORD, my daughter" (Ruth 3:10). Another interpretation: "for Your righteous judgments" (Psalms, there), for the judgments You brought upon the Egyptians in Egypt, and for the righteousness You did with our fathers in Egypt; for they had no commandments in their hands by which to be redeemed except two commandments, the blood of the Passover offering and the blood of circumcision, as it is written, "And I passed by you and saw you wallowing in your blood, and I said to you, 'In your blood, live'" (Ezekiel 16:6); "in your blood," the blood of the Passover offering and the blood of circumcision.

Themes