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.”