Ascribe to Yahweh the glory due to his name: Bring an offering, and come before him: Worship Yahweh in holy array.
So David gave him the lyrics, and these guys started singing and worshipping the Lord with this song or psalm.