Green’s Dictionary of Slang

dismal ditty n.

[SE dismal, dreary, cheerless + ditty]

a psalm recited on the gallows by a criminal who is about to die.

[UK]B.E. Dict. Canting Crew n.p.: Dismal Ditty a Psalm at the Gallows, also a dull Ballad, or silly Song.
[UK]New Canting Dict.
[UK]Bailey Universal Etym. Eng. Dict.
[UK]Dyche & Pardon New General Eng. Dict. (5th edn).
[UK]Grose Classical Dict. of the Vulgar Tongue.
[UK]Lex. Balatronicum.
[UK]Egan Grose’s Classical Dict. of the Vulgar Tongue.
[US]Matsell Vocabulum.
[US]Cairo Bull. (Cairo, IL) 5 Nov. 2/3: [from The Graphic, London] I’vew been inclined to make a change / Since Jerry hopped the twig, / And sang his dismal ditty, boys, / And danced old boss’s jog.