Rabbi Shmuel bar Nachman would make for these verses mnemonic signs: DYASH, ISHAKH, KSHDKH. David said, "I thank You, for You have answered me" (Psalms 118:21). Yishai said, "The stone that the builders rejected" (ibid. ibid. 22). His brothers said, "This is from the Lord" (ibid. ibid. 23). And Shmuel said, "This is the day the Lord has made; let us rejoice," etc. (ibid. ibid. 24). His brothers said, "Please, O Lord, save now" (ibid. ibid. 25). Yishai said, "Please, O Lord, grant success now" (ibid. ibid.). Shmuel said, "Blessed is he who comes in the name of the Lord" (ibid. ibid. 26). All of them said, "We bless you from the house of the Lord" (ibid. ibid.). David said, "You are my God, and I thank You" (ibid. ibid. 28). All of them said, "Give thanks to the Lord, for He is good, for His kindness endures forever."
Who Spoke Each Verse of Psalm 118 at David's Anointing
Midrash Shmuel 19:7
רבי שמואל בר נחמן הוה עביד לאילין פסוקיה סימנין דיא"ש איש"ך כשד"ך. דוד אמר אודך כי עניתני (תהלים קי"ח כ"א) ישי אמר אבן מאסו הבונים (שם שם כ"ב), אחוי אמרי מאת ה' היתה זאת (שם שם כ"ג), ושמואל אמר זה היום עשה ד' נגילה וגו' [שם כ"ד], אחיו אמרו אנא ה' הושיעה נא (שם שם כ"ה), ישי אמר אנא ה' הצליחה נא (שם שם), שמואל אמר ברוך הבא בשם ה' (שם שם כ"ו), כולם אמרו ברכנוכם מבית ה' (שם שם), דוד אמר אלי אתה ואודך (שם שם כ"ח), כולם אמרו הודו לה' כי טוב כי לעולם חסדו.