Cydney Henderson and Maria Puente

USA TODAY

Pharrell Williams is not "Happy" that President Donald Trump used his song.

The singer, 45, sent a cease-and-desist letter to Trump after the president played Williams' 2014 smash hit "Happy" at a political event in the Midwest Saturday, just hours after nearly a dozen people were gunned down in a Pittsburgh synagogue.

“On the day of the mass murder of 11 human beings at the hands of a deranged ‘nationalist,’ you played his song ‘Happy’ to a crowd at a political event in Indiana,” Williams' lawyer, Howard King, wrote in the letter obtained by USA TODAY.

Williams' legal team noted that the use of the song was not only poorly timed, but in violation of "copyright infringement" and "trademark rights."

Related: Chris Evans slams Trump in mocking tweet: 'No one has EVER been treated so unfairly.'

More: Kanye West designs 'Blexit' apparel to urge black voters to leave the Democratic party

"There was nothing ‘happy’ about the tragedy inflicted upon our country on Saturday and no permission was granted for your use of this song for this purpose,” the letter read.

The letter made it clear that Williams "will not" allow Trump to use any of his musical catalog in the future: "Demand is hereby made that you cease and desist from any further unauthorized use of Pharrell Williams' music."

This is not the first, or second, time Trump has caught flak for the song choices at his political events.

In August, Aerosmith frontman Steven Tyler sent Trump a cease-and-desist letter after the commander in chief played the band's hit song “Livin’ on the Edge” at a rally in Charleston, West Virginia.

“Mr. Trump is creating the false impression that our client has given his consent for the use of his music, and even that he endorses the presidency of Mr. Trump,” Tyler’s legal team said in a letter obtained by USA TODAY.

R.E.M., Prince's estate and Queen are among the other artists who have objected to the president's use of their music.

Nor is Trump the only politician to have been turned down by musicians with catchy songs. Bruce Springsteen's "Born in the U.S.A." was co-opted by politicians like President Ronald Reagan and former GOP presidential nominee Bob Dole after it came out in 1984, forcing Springsteen to push back.

But it's not so easy anymore to get away with it, says entertainment lawyer Zachary Elsea. For one thing, the internet and social media have increased the chances artists will find out that their music is being used without their permission.

"Second, many artists have demonstrated that they are willing to sue politicians who use their work without asking," says Elsea, whose California firm represented Jackson Browne’s successful lawsuit against John McCain’s campaign in 2008 for using a clip from "Running on Empty" in an ad mocking Barack Obama's positions on gas conservation.

"If an artist drops the matter after sending a cease-and-desist letter, then it remains easier to ask forgiveness than permission by just never using that artist’s work again," Elsea says.

"But these campaigns always run the risk of sparking expensive and protracted litigation if the artist is motivated to sue."

Related: Steven Tyler is seeing red after Trump played Aerosmith songs at rallies, again