Here’s how some greats have done it:
Hunter S. Thompson wrote Fear and Loathing in Las Vegas to a live version of “sympathy for the devil” on repeat. Stephen King is a metal guy*. David Foster Wallace mentions writing to Pink Floyd and Nirvana in his book length interview Although of Course you end up Becoming Yourself. He kept a poster of Alainis Morisette on his bedroom wall. Art of Manliness founder, Brett McKay puts on the manly film scores from Gladiator and Braveheart.
*King on writing