One figurative language device used in "A Psalm of Life" is metaphor, as the poem compares life to a battle and a bivouac. The lines "In the world's broad field of battle, / In the bivouac of Life" create a metaphor that portrays life as a military campaign or encampment. This metaphor contributes to the mood of the poem by emphasizing the challenges and struggles that one faces in life. The battle metaphor suggests that life is a constant fight, while the bivouac metaphor implies that life is temporary and fleeting.
Another figurative language device used in the poem is personification, as the poem gives human characteristics to the heart and drums. The lines "And our hearts, though stout and brave, / Still, like muffled drums, are beating / Funeral marches to the grave" personify the heart and drums, giving them the ability to beat in a mournful way like a funeral march. This personification contributes to the mood of the poem by creating a sense of melancholy and reminding the reader of the inevitability of death. It also emphasizes the importance of taking action and making the most of one's time while alive.