For the director of music. Of David. A psalm.

1 aI waited patiently for the LORD; he turned to me and heard my cry.
2 He lifted me out of the slimy pit, out of the mud and mire; he set my feet on a rock and gave me a firm place to stand.
3 He put a new song in my mouth, a hymn of praise to our God. Many will see and fear the LORDand put their trust in him.
4 Blessed is the one who trusts in the LORD, who does not look to the proud, to those who turn aside to false gods.b
5 Many, LORD my God, are the wonders you have done, the things you planned for us. None can compare with you; were I to speak and tell of your deeds, they would be too many to declare.
6 Sacrifice and offering you did not desire— but my ears you have openedc — burnt offerings and sin offeringsd you did not require.
7 Then I said, “Here I am, I have come— it is written about me in the scroll.e
8 I desire to do your will, my God; your law is within my heart.”
9 I proclaim your saving acts in the great assembly; I do not seal my lips, LORD, as you know.
10 I do not hide your righteousness in my heart; I speak of your faithfulness and your saving help. I do not conceal your love and your faithfulness from the great assembly.
11 Do not withhold your mercy from me, LORD; may your love and faithfulness always protect me.
12 For troubles without number surround me; my sins have overtaken me, and I cannot see. They are more than the hairs of my head, and my heart fails within me.
13 Be pleased to save me, LORD; come quickly, LORD, to help me.
14 May all who want to take my life be put to shame and confusion; may all who desire my ruin be turned back in disgrace.
15 May those who say to me, “Aha! Aha!” be appalled at their own shame.