Psalm 24
Psalm 24 is the 24th psalm of the Book of Psalms, beginning in English in the King James Version: "The earth is the LORD's, and the fulness thereof". In the slightly different numbering system used in the Greek Septuagint version of the Bible and the Latin Vulgate, this psalm is Psalm 23. In Latin, it is known as "Domini est terra et plenitudo eius orbis terrarum". The psalm is marked as a Psalm of David. The psalm is a regular part of Jewish, Catholic, Lutheran, Anglican and Nonconformist Protestant liturgies.
Psalm 24 is the 24th psalm of the Book of Psalms, beginning in English in the King James Version: "The earth is the LORD's, and the fulness thereof". In the slightly different numbering system used in the Greek Septuagint version of the Bible and the Latin Vulgate, this psalm is Psalm 23. In Latin, it is known as "Domini est terra et plenitudo eius orbis terrarum". The psalm is marked as a Psalm of David.
The psalm is a regular part of Jewish, Catholic, Lutheran, Anglican and Nonconformist Protestant liturgies. It has often been set to music, notably by Heinrich Schütz and Lili Boulanger. The section "Lift up your heads, O ye gates" has been associated with Advent, and paraphrased in hymns. The same dialogue, requesting the gates to open for the King of Glory, have also been associated with the feast of the Ascension, therefore Handel set it in Part II of his Messiah in the scene "Ascension", and Christoph Bernhard Verspoell wrote a related hymn, "Öffnet eure Tore", in 1810.

Background
David may have composed this psalm after buying the Temple Mount, intending for it to be sung at the dedication of the Temple by his son, Solomon. In verses 7 and 9, he instructs the gates of the Temple to open to receive God's glory at that time. The Talmud notes that when Solomon came to dedicate the Temple and bring in the Ark of the Covenant, the gates refused to open. They acceded only after Solomon prayed for them to open in the merit of his father, David. Another possible Sitz im Leben of Psalm 24 is the situation described in 1 Chronicles 15 and 2 Samuel 6 where David brings the Ark of the Covenant from Obed-Edom's house up to the Tabernacle in Jerusalem.

Text
Hebrew Bible version
Following is the Hebrew text of Psalm 24:

King James Version
The earth is the LORD's, and the fulness thereof; the world, and they that dwell therein.
For he hath founded it upon the seas, and established it upon the floods.
Who shall ascend into the hill of the LORD? or who shall stand in his holy place?
He that hath clean hands, and a pure heart; who hath not lifted up his soul unto vanity, nor sworn deceitfully.
He shall receive the blessing from the LORD, and righteousness from the God of his salvation.
This is the generation of them that seek him, that seek thy face, O Jacob. Selah.
Lift up your heads, O ye gates; and be ye lift up, ye everlasting doors; and the King of glory shall come in.
Who is this King of glory? The LORD strong and mighty, the LORD mighty in battle.
Lift up your heads, O ye gates; even lift them up, ye everlasting doors; and the King of glory shall come in.
Who is this King of glory? The LORD of hosts, he is the King of glory. Selah.

Themes
The Midrash Tehillim notes the inversion of the first two words of this psalm compared to the preceding one, Psalm 23. Psalm 23 begins, "Mizmor LeDavid, a song of David", while this psalm begins, "LeDavid Mizmor, of David, a song". The Midrash explains that Mizmor LeDavid indicates that first David played on his harp, and then God's spirit rested upon him. LeDavid Mizmor indicates that first he was imbued with the holy spirit, and then he played.The Talmud in Berakhot 35 a-b remarks on the discrepancy between verse 1, "The world and its contents belong to God", and Psalm 115:16, "The heavens are God's, but the earth He has given to humans". It concludes that these verses express the importance of saying a blessing over food. Before one says a blessing, the food belongs to God and to consume it would be akin to stealing, but after saying the blessing, one has permission to eat it.

Uses
Judaism
Psalm 24 is designated as the Psalm of the Day for the first day of the week (Sunday) in both the Ashkenazi and Sephardi liturgies. It was sung by the Levites after the offering of the regular daily sacrifice (tamid). This tradition continued into the diaspora, as the psalm is sung on Sundays in synagogues around the world. Ashkenazi Jews also recite the psalm while the Torah scroll is carried back to the ark on weekdays, Rosh Chodesh, festivals, and during the Shabbat afternoon prayer. Both Ashkenazi and Sephardi Jews recite it on Rosh Hashanah and Yom Kippur after the evening prayer. In the Siddur Avodas Yisroel, the psalm is also said after Aleinu during the evening prayer on weeknights. Some congregations recite this psalm during the hakafot on Simchat Torah.Verse 1 is said by the earth in Perek Shirah. Additionally, verses 7–8 are the first call of the rooster, and verses 9–10 are the second call of the rooster, in that ancient text.Verse 5 is a "companion verse" for the word yissa (Hebrew: יִשָּׂא, may He turn) in the Priestly Blessing (Numbers 6:26).Verses 7–10 are included in the ten verses recited during the section of Malchuyot in the Mussaf Amidah on Rosh Hashanah.Psalm 24 is also recited as a prayer for financial success and to protect from a flood.

Christianity
New Testament
Verse 1 is quoted in 1 Corinthians 10:26 of the New Testament.

Ascension and Advent
The dialogue of Psalm 24, verses 7–10, requesting the gates to open for the King of Glory, have been associated with the ascension of Jesus since the second century, when the Christian philosopher Justin described (in Dialog mit dem Juden Tryphon 36,4–6) a dialogue of heavenly lords who did not recognise Jesus because of his human appearance. Charles Spurgeon writes, "He who, fresh from the cross and the tomb, now rides through the gates of the New Jerusalem is higher than the heavens; great and everlasting as they are, those gates of pearl are all unworthy of him before whom the heavens are not pure, and who chargeth his angels with folly. Lift up your heads, O ye gates". Matthew Henry concurs, adding that the Ark being brought up to Jerusalem symbolizes Christ entering into heaven, "and the welcome given to him there".The same dialogue has also been associated with Advent.

Liturgy of the hours
In the pre-Tridentine Divine Office of the Catholic Church, the Psalm was said on Sundays at Prime.  It was reassigned to Tuesday at Prime by Pope Pius V. In the current Divine Office promulgated in 1971 (Liturgy of the Hours), with the suppression of Prime, it was reassigned to both Tuesday Week 1 Lauds, and Sunday Week 4 Office of Readings (Matins).

Book of Common Prayer
In the Church of England's Book of Common Prayer, this psalm is appointed to be read on the morning of the fifth day of the month, as well as at Evensong on Ascension Day.

Musical settings
Hymns
The Protestant minister Georg Weissel paraphrased the last section of Psalm 24 as an Advent hymn, "Macht hoch die Tür" (Make the door high) in 1623. It became Number 1 in the current Protestant hymnal Evangelisches Gesangbuch (EG), and appears in most German hymnals including the Catholic Gotteslob (GL 218). Catherine Winkworth translated it as "Lift up your heads, ye mighty gates" in 1853.The title of the hymn "Come Thou Almighty King", first published in 1757, is based on verse 10 of this psalm.Christoph Bernhard Verspoell wrote the 1810 hymn "Öffnet eure Tore" (Open your gates) for the Feast of the Ascension. The German text is based on the dialogue in verses 7–10, and a melody was added in a Trier hymnal of 1846.In the Free Church of Scotland's 2003 Psalter, Sing Psalms, the metrical version of Psalm 24 commences "The world and all in it are God’s, all peoples of the earth" and is set in the common metre. The recommended tunes are Nativity, Praetorius, Winchester and St. George's, Edinburgh.

Vocal music
Heinrich Schütz set the psalm in German for choir as part of his setting of the Becker Psalter as SWV 121, "Die Erd und was sich auf ihr regt" (The Earth and what moves on it). Andreas Hammerschmidt composed a six-part motet, "Machet die Tore weit" (Make the gates wide), setting verses 7–9.Verses 7–10 are set in Handel's his Messiah in the scene "Ascension" in 1742, in a scene called "Ascension".Henry Desmarest composed a grand motet, "Domini est terra" (unknown date).
Lili Boulanger set the entire psalm in French, La terre appartient à l’Eternel in 1916 for mixed choir, organ, brass ensemble, timpani and 2 harps.

References
Sources
Brauner, Reuven (2013). "Shimush Pesukim: Comprehensive Index to Liturgical and Ceremonial Uses of Biblical Verses and Passages" (PDF) (2nd ed.).
Nulman, Macy (1996). The Encyclopedia of Jewish Prayer: The Ashkenazic and Sephardic Rites. Jason Aronson. ISBN 978-1-4616-3124-8.
Scherman, Rabbi Nosson (2003). The Complete Artscroll Siddur (3rd ed.). Mesorah Publications, Ltd. ISBN 978-0-89906-650-9.
Scherman, Rabbi Nosson (1985). The Complete Artscroll Machzor – Rosh Hashanah (1st ed.). Mesorah Publications Ltd. ISBN 978-0-89906-676-9.
Slifkin, Nosson (2002). "Perek Shirah" (PDF). Zoo Torah.

External links

Pieces with text from Psalm 24: Scores at the International Music Score Library Project
Psalm 24: Free scores at the Choral Public Domain Library (ChoralWiki)
Text of Psalm 24 according to the 1928 Psalter
Psalms Chapter 24 text in Hebrew and English, mechon-mamre.org
A psalm of David. / The earth is the LORD’s and all it holds, the world and those who dwell in it. text and footnotes, usccb.org United States Conference of Catholic Bishops
Psalm 24:1 introduction and text, biblestudytools.com
Psalm 24 – The Great and Sovereign God enduringword.com
Psalm 24 / Refrain: The Lord of hosts: he is the King of glory. Church of England
Psalm 24 at biblegateway.com
Hymns for Psalm 24 hymnary.org