They brought in the ark of God, and set it in the midst of the tent that David had pitched for it: and they offered burnt offerings and peace-offerings before God.
So David gave him the lyrics, and these guys started singing and worshipping the Lord with this song or psalm.